Document Object Each HTML document loaded into a browser window becomes a Document object. The Document object provides access to all HTML elements in a page, from within a script. Tip: The Document object is also part of the Window object, and can be accessed through the window.document property. Document Object Collections W3C: W3C Standard. Collection Description [...]
Read More >>
HTML elements can be changed using JavaScript, the HTML DOM and events. Change an HTML Element HTML DOM and JavaScript can change the inner content and attributes of HTML elements. The following example changes the background color of the <body> element: Example <html> <body> <script type=”text/javascript”> document.body.bgColor=”lavender”; </script> </body> </html> Try it yourself » [...]
Read More >>
With the DOM, you can access every node in an HTML document. Accessing Nodes You can access a node in three ways: By using the getElementById() method By using the getElementsByTagName() method By navigating the node tree, using the node relationships The getElementById() Method The getElementById() method returns the element with the specified ID: Syntax [...]
Read More >>
The nodeName, nodeValue, and nodeType properties contain information about nodes. Node Properties In the HTML DOM, each node is an object. Objects have methods and properties that can be accessed and manipulated by JavaScript. Three important node properties are: nodeName nodeValue nodeType The nodeName Property The nodeName property specifies the name of a node. nodeName is [...]
Read More >>

The HTML DOM views a HTML document as a node-tree. All the nodes in the tree have relationships to each other. The HTML DOM Node Tree The HTML DOM views a HTML document as a tree-structure. The tree structure is called a node-tree. All nodes can be accessed through the tree. Their contents can be modified [...]
Read More >>