jQuery Reference Manual - Traversal

jQuery traversal functions

jQuery traversal functions include methods for filtering, finding, and chaining elements.

Function Description
.add() Adds elements to the set of matched elements.
.andSelf() Adds the previous element set in the stack to the current set.
.children() Obtains all child elements of each element in the matched element set.
.closest() Starts from the element itself and matches it against its parent elements level by level, returning the first matching ancestor element.
.contents() Obtains the child elements of each element in the matched element set, including text and comment nodes.
.each() Iterates over a jQuery object, executing a function for each matching element.
.end() Ends the most recent filtering operation in the current chain and returns the matched element set to the state before the last operation.
.eq() Reduces the matched element set to the element at the specified index.
.filter() Reduces the matched element set to new elements that match the selector or return value of a matching function.
.find() Obtains the descendants of each element in the current matched element set, filtered by the selector.
.first() Reduces the matched element set to the first element in the set.
.has() Reduces the matched element set to a set containing only the descendants of specific elements.
.is() Checks the current matched element set against a selector, and returns true if at least one matching element exists.
.last() Reduces the matched element set to the last element in the set.
.map() Passes each element in the current matched set to a function, creating a new jQuery object containing the return values.
.next() Obtains the adjacent sibling elements of each element in the matched element set.
.nextAll() Obtains all sibling elements after each element in the matched element set, filtered by the selector (optional).
.nextUntil() Obtains all sibling elements after each element, until an element matching the selector is encountered.
.not() Removes elements from the matched element set.
.offsetParent() Obtains the first parent element used for positioning.
.parent() Obtains the parent elements of each element in the current matched element set, filtered by the selector (optional).
.parents() Obtains the ancestor elements of each element in the current matched element set, filtered by the selector (optional).
.parentsUntil() Get the ancestor elements of each element in the current matched element set, until a matching selector is encountered.
.prev() Get the immediately preceding sibling element of each element in the matched element set, filtered by selector (optional).
.prevAll() Get all sibling elements before each element in the matched element set, filtered by selector (optional).
.prevUntil() Get all sibling elements before each element, until a matching selector is encountered.
.siblings() Get all sibling elements of the matched element set, filtered by selector (optional).
.slice() Reduce the set of matched elements to a subset of elements that are within the specified range.