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

Chapter 8. JavaScript Object-Oriented Pr... > The Document Object Model

The Document Object Model

In the JavaScript document object model (DOM), the primary document is an HTML page. As noted, the Window object, which includes frames, is at the top of the web browser hierarchy. However, the Document object contains the properties whose information is used by JavaScript. To strip away the mystery of what a DOM actually is, think of it as the Document object and all of its properties, including methods. Statements such as document.write() constitute the object (document) and a property/method (write()) that make up part of the model. To oversimplify a bit, you can say that the JavaScript DOM is the sum total of the Document object’s properties and methods, including the arrays automatically generated on an HTML page, and the manner in which these objects are accessed by JavaScript.

Document Properties

In looking at the Document properties, you might experience some sense of déjà vu from the section on the String object earlier in this chapter. You will see some similarities, but, for the most part, the properties (not including methods) that make up the DOM are unique to the Document object. Table 8.3 shows the properties of the Document object.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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