Node Navigation Basics

The concept of root nodes, parents, children, sibling nodes, text nodes, and attributes are very important because the navigation in the tree is based on these ideas.

The document tree is represented by the document JavaScript object. There are a number of document operations dedicated to navigation. The Listing below (it is based on the markup shown in Listing: The DOM tree) demonstrates a few methods of navigation.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy