When CSS-compliant browsers read your HTML files, they analyze this structure and create a structure of nodes , which you can think of as little chunks of information that describe your document. The nodes for the HTML above can be diagrammed as shown below. The top half of each node shows the nodeName , and the bottom half shows the nodeValue . You can click the diagram to open up a window that shows a larger version.
Nodes also contain information about their relationship to each other.
Let's look at these nodes as if they were members of a family tree. Node B 's parentNode is node A . Node B 's firstChild is node C , and its lastChild is node E . Node D has a previousSibling , which is node C , and a nextSibling , node E . Since node C has nobody to its left and nobody immediately below it, its previousSibling and firstChild properties will both be null .