• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 9. Using the document and body Objects > The document Object Properties

The document Object Properties

We’ve worked with the document object ever since Chapter 1, “Essential JavaScript,” and we’ll take a look at this object’s properties here. In Chapter 3, “The JavaScript Language: Loops, Functions, and Errors,” we took a look at this code (Listing 03-03.html on the web site) that loops over all the properties of the document object and displays them:

<HTML> 
    <HEAD> 
        <TITLE> 
            Using the for...in Loop 
        </TITLE> 
    </HEAD> 

    <BODY> 
        <H1>Using the for...in Loop</H1> 
        <SCRIPT LANGUAGE="JavaScript"> 
            <!--
            for (var property in document) {
					document.write(property + ": " + document[property] + "<BR>")
					} 
            // --> 
        </SCRIPT> 
    </BODY> 
</HTML> 


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint