Document Object Model (DOM)

The Document Object Model (DOM) is a platform- and language-independent interface that will allow programs and scripts to dynamically access and update the content, structure and style of documents.


We can say It is convention for representing and interacting with objects in HTML, XHTML and XML documents.Aspects of the DOM (such as its “Elements”) may be addressed and manipulated within the syntax of the programming language in use(JavaScript or others). The public interface of a DOM is specified in its application programming interface (API) called as client side programming.


The HTML DOM defines a standard way for accessing and manipulating HTML documents.


The DOM is a W3C (World Wide Web Consortium) standard.The DOM defines the objects and properties of all document elements, and the methods (interface) to access them.


In simple words : The HTML DOM is a standard for how to get, change, add, or delete HTML elements.


According to the DOM, everything in an HTML document (layout) is a node.


DOM says that:

  • The entire document is a document node
  • Every HTML element is an element node
  • The text in the HTML elements are text nodes
  • Every HTML attribute is an attribute node
  • Comments are comment nodes