jQuery traversal method


jQuery Traversal Method


jQuery Traversal method

##MethodDescription add()Add elements to the set of matching elementsaddBack()Add the previous set of elements to the current set andSelf()##children()## closest()Returns the first ancestor element of the selected elementcontents()Returns all direct child elements of the selected element ( Contains text and comment nodes)each()Execute the function for each matching elementend()End the latest filtering operation in the current chain, and return the set of matching elements to the previous stateeq()Return with The element with the specified index number of the selected elementfilter()Reduce the set of matching elements to new elements matching the selector or matching function return valuefind()Returns the descendant elements of the selected elementfirst()Returns the selected element The first elementhas()Returns all elements that have one or more elements inside itis()Checks the set of matching elements based on the selector/element/jQuery object, and returns true if there is at least one matching elementlast()Return the last element of the selected elementmap() Pass each element in the current matching set to the function and generate a return value The new jQuery objectnext()Returns the next sibling element of the selected elementReturns all sibling elements after the selected elementReturns each element between the two given parameters All sibling elements after the elementRemove the element from the set of matching elementsReturns the first positioned parent elementReturns the direct parent element of the selected elementReturns all ancestor elements of the selected elementReturns between two given All ancestor elements between the specified parametersReturns the previous sibling element of the selected elementReturns all sibling elements before the selected elementReturns between the two given parameters All sibling elements before each element between ##siblings()Returns all sibling elements of the selected elementslice()Reduce the set of matching elements to a subset of the specified range
Deprecated in version 1.8. Alias ​​for addBack()
Returns all direct child elements of the selected element
##nextAll()
nextUntil()
not()
offsetParent( )
parent()
parents()
parentsUntil()
prev()
prevAll()
prevUntil()