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

Description

The HTMLDocument object represents the current document loaded into the window. In earlier browsers, the <body>...</body> element defines the document whereas the <html>...</html> element defines the root of the document. Thanks to the Document Object Model, the HTMLDocument is an independent and superior (in the hierarchy) object to any other object in the tree of nodes.

One Method, Two Properties, and Compatibility with Three Browsers

In Chapter 20, “Core DOM Objects,” I discussed the document.getElementById() method. In this chapter I explain the document.layers and document.all properties. Two of these are very similar, and the third works the same as the other two in regards to positioned content (for instance, a <div>...</div> element with style attributes designating where on the document it goes). This similarity of objects doing the same thing (almost) and having different names reminds us of the headaches we all have in writing for 4.x browsers. For those of you fortunate enough to write for Internet Explorer 5+ and Netscape 6 exclusively, a little background is necessary.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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