HTML DOM Ins Object | HTML Dom Object | HTML Dom | Domobject

HTML DOM Ins Object


The HTML DOM Document Object

« Previous

Next Reference »


HTML DOM Nodes

In the HTML DOM (Document Object Model), everything is a node:

  • The document itself is a document node
  • All HTML elements are element nodes
  • All HTML attributes are attribute nodes
  • Text inside HTML elements are text nodes
  • Comments are comment nodes

The Document Object

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.


Browser Support

Object          
Document Yes Yes Yes Yes Yes

The Document Object is supported in all major browsers.


Document Object Properties and Methods

The following properties and methods can be used on HTML documents: