O'Reilly logo

jQuery and jQuery UI: Visual QuickStart Guide by Jay Blanchard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

6. Traversing the DOM Tree

To paraphrase a line from a famous Christmas story, “Yes, Virginia, we can get there from here—even if there are a lot of steps along the way.”

Selectors are usually fine for identifying elements that you want to work with while using jQuery, but you’ll often find that you need to identify other elements on your pages based on their relationship to the selected elements. These elements might be parents, grandparents, children, or siblings, and the basic concept is that you’re moving up, down, and sideways in the family tree (the DOM) based on which limb you’re currently standing on (the selected elements). This movement is known as

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required