author:php.cn update time:2022-04-12 17:13:43
jQuery traversal method
jQuery Traversal Method
jQuery Traversal method
##Method | Description |
add() | Add elements to the set of matching elements |
addBack() | Add the previous set of elements to the current set |
andSelf() | Deprecated in version 1.8. Alias for addBack() |
##children() Returns all direct child elements of the selected element | | ## closest()
Returns the first ancestor element of the selected element | | contents()
Returns all direct child elements of the selected element ( Contains text and comment nodes) | | each()
Execute the function for each matching element | | end()
End the latest filtering operation in the current chain, and return the set of matching elements to the previous state | | eq()
Return with The element with the specified index number of the selected element | | filter()
Reduce the set of matching elements to new elements matching the selector or matching function return value | | find()
Returns the descendant elements of the selected element | | first()
Returns the selected element The first element | | has()
Returns all elements that have one or more elements inside it | | is()
Checks the set of matching elements based on the selector/element/jQuery object, and returns true if there is at least one matching element | | last()
Return the last element of the selected element | | map()
Pass each element in the current matching set to the function and generate a return value The new jQuery object | | next()
Returns the next sibling element of the selected element | ##nextAll() |
Returns all sibling elements after the selected element | nextUntil() |
Returns each element between the two given parameters All sibling elements after the element | not() |
Remove the element from the set of matching elements | offsetParent( ) |
Returns the first positioned parent element | parent() |
Returns the direct parent element of the selected element | parents() |
Returns all ancestor elements of the selected element | parentsUntil() |
Returns between two given All ancestor elements between the specified parameters | prev() |
Returns the previous sibling element of the selected element | prevAll() |
Returns all sibling elements before the selected element | prevUntil() |
Returns between the two given parameters All sibling elements before each element between | ##siblings() | Returns all sibling elements of the selected element
| slice() | Reduce the set of matching elements to a subset of the specified range
| |