How can I format the text in a JavaScript alert box? I need a word in the text to be underlined.
Needed this badly, but none of the answers were particular helpful. As two answers suggest the solution is to use unicode, but you have to do this properly! I also wanted a more reuseable solution where I not needed to reinvent the wheel each and every time. So came up with this small javascript function for convenience.
alert('Really need to alert some '+toUnicodeVariant('underlined', 'bold sans', 'underline')+' text');
Should produce something like this in all major browsers (try run the code snippet above) :