In your sample document after the line
document.write("Hello World!");
Add
document.write("It's A Wonderful Day.");
And resave and run the new program.
Notice how the text runs together.
When writing to the HTML document, you must always remember that it is processed as if it was normal html, all html tags will be honoured and processed.
Change the following lines in your program
document.write("Hello World!");
document.write("It's A Wonderful Day.");
To read
document.write("Hello World!<P>");
document.write("It's A <B>Wonderful Day</B><P>.");
Rerun the program.
Just after the body tag add the line.
<H1>My JavaScript Program
Between the two document.write statements
Add The following
document.write("</H1><I>");
Before the </body> tag add the line
That's All!
Rerun the program.
While viewing the document do a View Source and observe the results.
A variation on the write method is the writeln method, which puts out an eoln after printing out the string characters. This is not useful in formatting the text as HTML ignores the eoln in the document. It's only useful if you are outputting text with the <PRE>tag.