document.writeln(string) will create/write whatever string you specify, whether string is a variable, or a literal.
In theory, writeln is supposed to do a carriage return at the end of the line, but when I tested it, it didn't work right. So if you want to ensure a line break, just use write instead of writeln, and in the write, include the <br /> or <p> tag.
Output:
Code:
<script type="text/javascript"> //<![CDATA[
document.write("This uses <strong>writeln</strong>:<br />"); document.writeln("line1"); document.writeln("line2"); document.writeln("line3"); document.write("<br /><br />This uses <strong>write</strong> and <br />:<br />"); document.write("line1<br />"); document.write("line2<br />"); document.write("line3<br />"); //]]> </script>