With JavaScript, you can reconstruct an entire HTML document. You can add, remove, change, or rearrange items on the page.
To change something on the page, JavaScript needs access to all elements in the HTML document. This entry, along with the methods and properties for adding, moving, changing, or removing HTML elements, is obtained through the Document Object Model (DOM).
In 1998, the W3C published the first level of the DOM specification. This specification allows access and manipulation of every individual element in an HTML page.
All browsers implement this standard, so DOM compatibility issues are almost impossible to find.
The DOM can be used by JavaScript to read and change HTML, XHTML, and XML documents.