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

Chapter 29. Introduction to DHTML > The Document Object Model

29.3. The Document Object Model

The Document Object Model exposes every element of an HTML page to a scripting language, such as JavaScript. Early iterations of the DOM, now called DOM Level 0 and retained for backwards compatibility, gave scripts access to only some objects on a page, including forms, frames, and images. DOM Level 1 and DOM Level 2, however, allow you to access and change almost any part of an HTML (or XHTML) document, so you can modify, add, or remove attributes or even entire elements. (For more information on the DOM specifications, see http://www.w3.org/DOM/.)

In JavaScript parlance, each element of the page is an object. The DOM begins with a base object called the document object, which refers to the HTML page itself and everything in it. All the elements contained within the HTML page, such as headings, paragraphs, images, forms, and links, are represented by separate objects. These objects branch off from the document object, like branches from a tree trunk, to form a hierarchy of elements.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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