Easy Tutorial
❮ Traversing Is Jquery Hide Show ❯

jQuery "Traversal"


What is Traversal?

jQuery traversal, meaning "move," is used to "find" (or select) HTML elements based on their relationship to other elements. Starting with a selection, you move along this selection until you reach the desired element.

The diagram below shows a family tree. With jQuery traversal, you can easily move up (ancestors), down (descendants), and horizontally (siblings) in the family tree, starting from the selected (current) element. This movement is referred to as traversing the DOM.

Diagram Explanation:

| | Ancestors are parent, grandparent, great-grandparent, etc. Descendants are child, grandchild, great-grandchild, etc. Siblings have the same parent. | | --- | --- |


Traversing the DOM

jQuery provides various methods for traversing the DOM.

The largest category of traversal methods is tree traversal.

The next chapter will explain how to move up, down, and sideways in the DOM tree.

❮ Traversing Is Jquery Hide Show ❯