In the HTML DOM (Document Object Model), everything is a node:
When an HTML document is loaded into a web browser, it becomes a document object.
The document object is the root node of the HTML document and the "owner" of all other nodes:
(element nodes, text nodes, attribute nodes, and comment nodes).
The document object provides properties and methods to access all node objects, from within JavaScript.
Tip: The document is a part of the Window object and can be accessed as window.document.
Object | |||||
---|---|---|---|---|---|
Document | Yes | Yes | Yes | Yes | Yes |
The Document Object is supported in all major browsers.
The following properties and methods can be used on HTML documents: