DOM: Document Object Model

THIS DOCUMENT IS PART STUB. When a page is processed by the browser it builds a tree like structure. At the top is the window (pg. 229), but you can skip it and refer to the document directly. At this point be aware that you can access the body object's style attribtue/property(which is near the top of the tree) by going down through the document object/node using this pattern: document.body.style.theStyle='some-value'. Also, see w3schools.

Examples:

The code:

<p onclick="document.body.style.textDecoration='underline'"
     ondblclick="document.body.style.textDecoration='none'">
   Click to underline the WHOLE page.<br />
   Double click to remove the underline.
</p>

...as it appears on the Page:

Click to underline the WHOLE page.
Double click to remove the underline.

See also: this, Nesting Quotes

Back to Knowledge Dump