Navigating in the Document Tree
Explore the structure of the DOM document tree by understanding nodes, their parent-child relationships, attributes, and siblings. This lesson helps you grasp how HTML elements, texts, and attributes form a hierarchy essential to navigating and manipulating web pages.
We'll cover the following...
As is obvious, the entire document that represents a web page can be depicted as a tree. This tree is built up from nodes, where each node has exactly one parent, except the root node that has no parent, and each node may have zero, one, or more child nodes. HTML elements, texts, and attributes of elements are all nodes in this tree.
The image in the DOM Basics lesson already showed you a simple HTML markup as a hierarchy.
The image given below shows a bit more compound markup; its ...