DOM traversal under the hood

In Chapter 2, Selecting Elements, and again at the beginning of this chapter, we looked at ways of traveling from one set of DOM elements to another by calling DOM traversal methods. Our (far from exhaustive) survey of such methods included simple ways to reach neighboring cells, such as .next() and .parent(), and more complex avenues of combining selector expressions, such as .find() and .filter(). By now, we should have a fairly strong grasp of these ways of getting from one DOM element to another step-by-step.

Each time we take one of these steps, though, jQuery takes note of our travels, laying down a trail of breadcrumbs we can follow back home if needed. A couple of the methods we briefly touched on in that chapter, ...

Get Learning jQuery - Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.