Javascript: Lesson 1

An instance of document.write():

An instance of document.writeln():

Note: No noticeable difference between document.write() and document.writeln().


Several instances of document.write():

Several instances of document.writeln():

Note: The document.writeln() appends a newline character after it separating it from succeeding instances.


Several instances of document.write() in <pre></pre> tags:


Several instances of document.writeln() in <pre></pre> tags:


HTML 4.01 indicates the following about <pre> ... </pre>:

<pre> ... </pre> Preformated Text Definition:
Forces the browser to display the exact formatting, indentation, and white space that the original text contains. This is valuable in reproducing formatted tables or other text, such as code listings.
Suggested Style/Usage of <pre> ... </pre>:
Within the <pre> ... </pre> block, you can break lines by pressing Enter, but try to keep line lengths at 80 columns or fewer because <pre> text is typically set in a monospaced font. This tag is great for presenting text-only information.

Notes on scripts that are placed inside <pre> ... </pre> block:


© 2001 Kiner Designs

Valid HTML 4.0!

Valid CSS!