12.9. Special (Escaped) String Characters
These characters come in handy for alert, confirm, and prompt dialog box text. For example, if you want to display multiple paragraphs with a blank line between them in an alert box, you would insert line feed characters:
alert("First paragraph.\n\nSecond paragraph.")
Note that these characters apply to strings, and do not influence HTML content formatting for carriage returns.
Copyright © 2003 O'Reilly & Associates. All rights reserved.