jQuery Traversal
What is traversal?
jQuery traversal, meaning "moving", is used to "find" (or select) HTML elements based on their relationship to other elements. It starts with a selection and moves along that selection until it reaches the element you desire.
The figure below shows a family tree. With jQuery traversal, you can start from the selected (current) element and easily move up (ancestors), down (descendants), and horizontally (siblings) in the family tree. This movement is called traversing the DOM.

Diagram explanation:
-
element is
-
the parent of the ... element and the ancestor of all the content within it.
-
-
element is
- the parent of the ... element, and also
a child of the ... element
- the one on the left
- element is the parent of the ...,
-
a child of the ..., and also
- element is
- a child of the ..., and also
-
and
- two
- elements are siblings (they share the same parent element).
- the one on the right
- element is the parent of the ...,
-
a child of the ..., and also
- element is on the right of the
- a child of the ..., and also
-
and
a descendant of the ...
Ancestors are parents, grandparents, great-grandparents, and so on. Descendants are children, grandchildren, great-grandchildren, and so on. Siblings share the same parent.
Traversing the DOM
jQuery provides several methods for traversing the DOM.
The largest category of traversal methods is tree traversal (tree-traversal).
The next chapter explains how to move up, down, and sideways in the DOM tree.
a descendant of the ...
a descendant of the ...
a descendant of the ...
- the parent of the ... element, and also
-