81Chapter 14 .Document Object Model Essentials (Web hosting mysql) According to
81Chapter 14 .Document Object Model Essentials According to W3C DOM terminology, each container, standalone element (such as a BR element), or text chunk is known as a node a fundamental building block of the W3C DOM. Nodes have parent-child relationships when one container holds another. As in real life, parent-child relationships extend only between adjacent generations, so a node can have zero or more children. However, the number of third-generation nodes further nested within the family tree does not influence the number of children associated with a parent. Therefore, in Listing 14-1, the HTML node has two child nodes, HEAD and BODY, which are siblings that share the same parent. The BODY element has one child (P) even though that child contains three children (two text nodes and an EM element node). If you draw a hierarchical tree diagram of the document in Listing 14-1, it should look like the illustration in Figure 14-3. document +– +–
| +– +–”This is the ” +– | +–”one and only” +–” paragraph on the page.” Figure 14-3: Tree diagram of nodes for the document in Listing 14-1 Note If the document s source code contains a Document Type Definition (DTD) above the tag, the browser treats that DTD node as a sibling of the HTML element node. In that case, the root document node contains two child nodes. The W3C DOM (through Level 2) defines 12 different types of nodes, seven of which have direct application in HTML documents. These seven types of nodes appear in Table 14-3 (the rest apply to XML). Of the 12 types, the three most common are the document, element, and text fragment types. The latter two are implemented in both IE5+ and NN6 (all are implemented in NN6).
Check Tomcat Web Hosting services for best quality webspace to host your web application.