Web Development with jQuery®

(Elliott) #1

bapp03.indd 02/17/2015 Page 501


Selecting, Traversing, and


Filtering


METHOD/PROPERTY DESCRIPTION RETURN
VALUE

SELECTING

$(selector) Makes a selection from the document. jQuery

jQuery(selector) An alternative name for the preceding dollar
sign method.

jQuery

length The number of selected elements. Number

get() Returns all selected elements as an array,
rather than as a jQuery object.

Array

get(index) Returns a single element from the selection;
the index argument is the element’s position
in the selection, offset from zero.

Element

index(subject) Searches the selection for the specifi ed ele-
ment and returns that element’s position in
the selection offset from zero.

Number

TRAVERSING AND FILTERING

add(selector) Adds one or more elements to the selection
by virtue of an additional selector.

jQuery

add(elements) Adds one or more elements to the selec-
tion by virtue of one or more element object
references.

jQuery

C


continues

http://www.it-ebooks.info

Free download pdf