You are here: irt.org | FAQ | JavaScript | Text | Q1752 [ previous next ]
Yes. Although if you do not use the pre tag the output will simply ignore the newline character. Try for example:
<pre>
<script language="JavaScript"><!--
document.write('1\n2\n3\n4\n5');
//--></script>
</pre>or:
<pre>
<script language="JavaScript"><!--
document.writeln('1');
document.writeln('2');
document.writeln('3');
document.writeln('4');
document.writeln('5');
//--></script>
</pre>