Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery Traversal Methods

jQuery Traversal Methods


jQuery Traversal Methods

Method Description
add() Add elements to the set of matched elements
addBack() Add the previous set of elements to the current set
andSelf() Deprecated in version 1.8. An alias for addBack()
children() Return all direct children of the selected elements
closest() Return the first ancestor of the selected element
contents() Return all direct children of the selected element (including text and comment nodes)
each() Execute 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() Return the element with the specified index number among the selected elements
filter() Reduce the set of matched elements to those that match a selector or pass the test of a function
find() Return the descendant elements of the selected element
first() Return the first element of the selected elements
has() Return all elements that contain one or more elements
is() Check the set of matched elements against a selector/element/jQuery object, returning true if at least one matching element exists
last() Return the last element of the selected elements
map() Pass each element in the current matched set through a function, producing a new jQuery object containing the returned values
next() Return the next sibling element of the selected element
nextAll() Return all sibling elements after the selected element
nextUntil() Return all sibling elements following each element, up to (but not including) the one matched by the given argument
not() Remove elements from the set of matched elements
offsetParent() Return the first positioned parent element
parent() Return the direct parent of the selected element
parents() Return all ancestor elements of the selected element
parentsUntil() Return all ancestor elements between the two given arguments
prev() Return the previous sibling element of the selected element
prevAll() Return all sibling elements before the selected element
prevUntil() Return all sibling elements before each element, up to (but not including) the one matched by the given argument
siblings() Return all sibling elements of the selected element
slice() Reduce the set of matched elements to a subset specified by a range