4. | In a separate text document, on the first line, type document.write(
|
5. | If desired, type "<tag>"+, where tag is the (X)HTML structure you'd like to apply to the date.
|
6. | Next type Date() to call JavaScript's internal date function.
|
7. | If you've added an element in step 5, type +"<\/tag>", where tag is the corresponding closing tag. Notice the extra backslash that hides (X)HTML's forward slash / from JavaScript.
|
8. | Type ) to finish the document.write function (Figure 20.1).

|
9. | Save the document as in text-only format, using the file name time.js.
|
10. | In your (X)HTML document, place the cursor where the time should appear.
|
11. | Type <script type="text/javascript" language="javascript" src="time.js"> </script> to call the script from that location (Figure 20.2).


|