Have an Alert box with new line in itTag(s): Language

<SCRIPT>
alert("line1\r\nline2\r\nline3");
</SCRIPT>
This tip is also good for inserting new line into a TextArea.

"\r\n" stands for carriage Return and New line. On Netscape, only the \n may be necessary but with Explorer, you need both. To be compatible with both always use the combination "\r\n".




If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2012
[ home ]