Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
• The Document Object Model (p. 396) gives you access to all the elements on a web page. Using JavaScript, you can dynamically create, modify and remove elements in the page.
• The getElementById method returns objects called DOM nodes (p. 396). Every element in an HTML5 page is modeled in the web browser by a DOM node.
• All the nodes in a document make up the page’s DOM tree (p. 396), which describes the relationships among elements.
• Nodes are related to each other through child-parent relationships. An HTML5 element inside another element is said to be its child (p. 396)—the containing element is known as the parent (p. 396). A node can have multiple children but only one parent. Nodes with the same parent node are referred to as siblings (p. 396).