JavaScript Tutorials - Herong's Tutorial Examples - 2.33, by Herong Yang
The document.write() Method
This section provides a quick description of the document.write() method and a simple tutorial example of using the document.write() method.
As we can see from the sample JavaScript in the previous section, the "document.write(string)" method is a very useful method. Here are some notes about this method:
You can use the "document.write(string)" method to write anything, including HTML tags, into the HTML document.
Here is a tutorial example that shows you how to use the document.write() method to write a large section of a HTML document:
<html> <!-- Document_Write.html Copyright (c) 2002 HerongYang.com. All Rights Reserved. --> <head><title>The document.write() Method</title></head> <body> <script type="text/javascript"> document.write('<center>'); document.write('Summer summer oh so hot,<br/>'); document.write('Summer summer trapped in a pot.<br/>'); document.write('When I open the lid I let you out,<br/>'); document.write('You make me so happy<br/>'); document.write('I want to shout!<br/>'); document.write('</center>'); </script> </body> </html>
Table of Contents
First JavaScript - "Hello World!"
Walking through the First JavaScript
ECMAScript Language Specification and JavaScript Dialects
Data Types, Variables and Expressions
Creating, Accessing, and Manipulating Arrays
Defining and Calling Functions
Web Browser Supporting JavaScript
Server-Side and Client-Side Web Scripting
Defining Your Own Object Types
Inheritance of Properties and Methods through the Prototype Object Chain
'jrunscript' - JavaScript Shell Command from JDK
Using Functions as "Function" Objects
Introduction to Built-in Object Types
W3C's Document Object Model (DOM) Specifications