The document object is an object created automatically by the browser for each new HTML page that is viewed and you can access a number of properties and methods that can affect the document which are very useful when writing scripts.
<body> <h1>Nodes and child nodes</h1> <img src="myimage.jpg" alt="My Image" /> </body>
The body element is a node. It has two child nodes: the h1 element and the img element. The h1 contains a text node as its child node. The img element contains two attribute nodes: