Where does HTML DOM start? window? document? document.defaultView?
document, dom, javascript, window
Solution
The DOM (Document Object Model) begins at the `document` node. It is referred to as the "root node".
Observe the following tree (corresponding `nodeType`s in parentheses):
[HTMLDocument](9)
[DocumentType](10)
[HTMLHTMLElement](1)
[HTMLHeadElement](1)
[HTMLTitleElement](1)
[Text]Title(3)
[HTMLBodyElement](1)
The tree¹ would be formed from the following markup:
<!DOCTYPE HTML><html><head><title>Title</title></head></body></html>
Note the distinct lack of whitespace. Adding whitespace would add text nodes to the document tree and clearly make it more difficult to simulate.
The `window` object is not part of the DOM. It is a host object implemented as the "global object" to complete an ECMAScript implementation. It has its own standard which is available from the W3C. Whereas the global object is required to complete an ECMAScript implementation, the DOM is not. This is exemplified in the node.js environment.
¹ Certain environments ignore the doctype node. I've observed Opera 5-9 and Safari 3.1 as environments that exhibit this behaviour.
Problem
As the title. And is there a picture which introduces HTML DOM's construct?