If the example code given had a typo and should've read like this:
var result = window.prompt("Please enter your name","Andrew");
then the answer is that you can't format the text or change the labels on the buttons or anything. This applies to the built-in alert() and confirm() as well as to prompt().
It's a bit more work, but you can implement your own equivalent dialog by building one from HTML using a transparent <div> to cover the rest of your page so that users can't interact with the rest of the page until the dialog closes. (Or use a translucent <div> to make it more obvious to the user that the rest of the page is "disabled".)
I would not bother coding this from scratch when there are lots of JS libraries that do it for you. The jQuery dialog is pretty easy to use, to name just one option.
var result = "Andrew";, the first string is just discarded. Besides, any formatting like underlining depends on how you display the message, so you have to specify that also.