The Document Object Model, usually referred to as the DOM, is an essential part of making websites interactive.
The Document Object Model represents the HTML document that is displayed in a window.
When a web page is loaded, the browser creates a Document Object Model of the page.
The HTML DOM model is constructed as a tree of Objects.
Below is an example that explains what is DOM:
<p>This is an example page</p>
The DOM represents of above code is like this:
DOM representation of above example
The HTML DOM is a standard object model and programming interface for HTML. It defines:
In other words: The HTML DOM is a standard for how to get, change, add, or delete HTML elements.
In the next chapters of this tutorial you will learn: