--- title: HTML Dom --- ## HTML Dom With the HTML DOM, JavaScript can access and change all the elements of an HTML document. When a web page is loaded, the browser creates a **D**ocument **O**bject **M**odel of the page. The HTML DOM model is constructed as a tree of Objects: Each element in the DOM is also called a node. ```html My title My Link

My header

``` The DOM for the above HTML is as follows: ![DOM tree](https://www.w3schools.com/js/pic_htmltree.gif) With the object model, JavaScript gets all the power it needs to create dynamic HTML: * JavaScript can change all the HTML elements in the page * JavaScript can change all the HTML attributes in the page * JavaScript can change all the CSS styles in the page * JavaScript can remove existing HTML elements and attributes * JavaScript can add new HTML elements and attributes * JavaScript can react to all existing HTML events in the page * JavaScript can create new HTML events in the page #### More Information: W3C - HTML DOM