PDA

View Full Version : Inserting special characters in an alert message



Jim Weinberg
02-14-2006, 06:50 PM
Can someone please tell me how to insert a carriage return and linefeed into an alert message so that I can space the message out?

Thanks.

Twey
02-14-2006, 07:03 PM
There's no need to use CRLF; Javascript uses UNIX-style linebreaks (only CR), which are far more logical, if you ask me:

window.alert("Hello\nWelcome to my site");