jQuery: The Write Less, Do More JavaScript Library

API/1.2/Traversing

From jQuery JavaScript Library

(Redirected from Traversing)
Jump to: navigation, search

NameType
Filtering:

NameType
eq( index ) Returns: jQuery
Reduce the set of matched elements to a single element.
hasClass( class ) Returns: Boolean
Checks the current selection against a class and returns true, if at least one element of the selection has the given class.
filter( expr ) Returns: jQuery
Removes all elements from the set of matched elements that do not match the specified expression(s).
filter( fn ) Returns: jQuery
Removes all elements from the set of matched elements that does not match the specified function.
is( expr ) Returns: Boolean
Checks the current selection against an expression and returns true, if at least one element of the selection fits the given expression.
map( callback ) Returns: jQuery
Translate a set of elements in the jQuery object into another set of values in an array (which may, or may not, be elements).
not( expr ) Returns: jQuery
Removes elements matching the specified expression from the set of matched elements.
slice( start, end ) Returns: jQuery
Selects a subset of the matched elements.
Finding:

NameType
add( expr ) Returns: jQuery
Adds more elements, matched by the given expression, to the set of matched elements.
children( expr ) Returns: jQuery
Get a set of elements containing all of the unique immediate children of each of the matched set of elements.
contents( ) Returns: jQuery
Find all the child nodes inside the matched elements (including text nodes), or the content document, if the element is an iframe.
find( expr ) Returns: jQuery
Searches for all elements that match the specified expression. This method is a good way to find additional descendant elements with which to process.
next( expr ) Returns: jQuery
Get a set of elements containing the unique next siblings of each of the given set of elements.
nextAll( expr ) Returns: jQuery
Find all sibling elements after the current element.
parent( expr ) Returns: jQuery
Get a set of elements containing the unique parents of the matched set of elements.
parents( expr ) Returns: jQuery
Get a set of elements containing the unique ancestors of the matched set of elements (except for the root element).

The matched elements can be filtered with an optional expression.

prev( expr ) Returns: jQuery
Get a set of elements containing the unique previous siblings of each of the matched set of elements.
prevAll( expr ) Returns: jQuery
Find all sibling elements before the current element.
siblings( expr ) Returns: jQuery
Get a set of elements containing all of the unique siblings of each of the matched set of elements.

Can be filtered with an optional expressions.

Chaining:

NameType
andSelf( ) Returns: jQuery
Add the previous selection to the current selection.
end( ) Returns: jQuery
Revert the most recent 'destructive' operation, changing the set of matched elements to its previous state (right before the destructive operation).