In a separate text document, on the first line, type document.write(
If desired, type "<tag>"+, where tag is the (X)HTML structure you'd like to apply to the date.
to finish the document.write
function (Figure 20.1)
Figure 20.1. I recommend creating your Java-Script scripts in independent, external documents. They should be saved in text-only format with the .js extension. For example, this file is called time.js. Notice that there is no return; it wraps here in order to fit in this narrow width column.
Save the document as in text-only format, using the file name time.js.
In your (X)HTML document, place the cursor where the time should appear.
to call the script from that location (Figure 20.2)
Figure 20.2. Put the script element in the place in your (X)HTML document where you'd like the time to appear. Note that the language attribute is deprecated and thus only valid in (X)HTML transitional (see page 313).
Figure 20.3. A time stamp on your page makes it appear more current. You just have to make sure the content is up to date as well.