This script will write the words, HI Everybody on your webpage. Now, this is a very simple script, and you can use HTML to write words on your page, but the basis of this script will be very important later on, so it is important to learn this one. Let’s look at each element of the script.
The next part of our script is:
The document is an object. We discussed this earlier, remember? Write is the method (or function) that we want to use on the document. It is presented with a period between the two words: document.write. The write method is actually presented as write() with what you want written inside the parentheses.
Note that we have also added a little HTML into the mix with the use of tags that will force the text to be printed in italics. We’ve written the object, the method, and the string so that now the script has everything it needs to run. We’ve also closed or ended the comment, and then the script with the following: