bapp03.indd 02/17/2015 Page 501
Selecting, Traversing, and
Filtering
METHOD/PROPERTY DESCRIPTION RETURN
VALUESELECTING$(selector) Makes a selection from the document. jQueryjQuery(selector) An alternative name for the preceding dollar
sign method.jQuerylength The number of selected elements. Numberget() Returns all selected elements as an array,
rather than as a jQuery object.Arrayget(index) Returns a single element from the selection;
the index argument is the element’s position
in the selection, offset from zero.Elementindex(subject) Searches the selection for the specifi ed ele-
ment and returns that element’s position in
the selection offset from zero.NumberTRAVERSING AND FILTERINGadd(selector) Adds one or more elements to the selection
by virtue of an additional selector.jQueryadd(elements) Adds one or more elements to the selec-
tion by virtue of one or more element object
references.jQueryC
continues