jQuery: Other common traversing methods

This entry is part 27 of 33 in the series jQuery Tutorial

We have looked at find and and we have looked at children.

Here are other common traversing methods.

MethodsDescription
.add()Add elements to the set of matched elements.
.children()Get the children of each element in the set of matched elements, optionally filtered by a selector.
.each()Iterate over a jQuery object, executing a function for each matched element.
.end()End the most recent filtering operation in the current chain and return the set of matched elements to its previous state.
.eq()Reduce the set of matched elements to the one at the specified index.
.filter()Reduce the set of matched elements to those that match the selector or pass the function’s test.
.find()Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
.first()Reduce the set of matched elements to the first in the set.
.has()Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
.last()Reduce the set of matched elements to the final one in the set.
.next()Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.
.not()Remove elements from the set of matched elements.
.parent()Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
.siblings()Get the siblings of each element in the set of matched elements, optionally filtered by a selector.
.prev()Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector.
Series Navigation<< jQuery: find
jQuery: .eq() >>

Leave a comment

Leave a Reply