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

Chapter 15. Dynamic HTML: Style Sheets, ... > Where Does JavaScript Fit In?

15.4. Where Does JavaScript Fit In?

The W3C DOM (level 1) provides JavaScript applications a standard way to access all the elements of the document. In order for JavaScript to change the style of a document dynamically, the HTML tags must be represented as objects. We have already discussed the hierarchical tree-like structure of the document object model in Chapter 11, “The Document Objects: Forms, Images, and Links.”

15.4.1. How the DOM Works with Nodes

Now we will take the DOM to a new level. Just as we used the DOM to access forms, images, and links as objects, now we can use the DOM to access every element in an HTML document. The standard DOM level 1 currently consists of two parts: the DOM core and the DOM HTML (see http://www.w3.org/TR/REC-DOM-Level-1/introduction.html). The DOM core specifies a standard way to manipulate document structures, elements, and attributes; the DOM HTML just extends that functionality to HTML. Recall that the DOM represented an HTML document as a tree: with the DOM, every HTML element can be defined as part of the tree, as shown in Figure 15.23.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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