The HTML Document Object Model
With JavaScript you can restructure an entire HTML document: add,
remove, change, or reorder items on a page.
This requires access to the Document Object Model (DOM)—methods
and properties to add, move, change, or remove HTML elements.
According to the DOM, every HTML document is a hierarchy of nodes:
- The entire document is a document node
- Every HTML tag is an element node
- The texts contained in the HTML elements are text nodes
- Every HTML attribute is an attribute node
- Comments are comment nodes