jQuery 学习列表
1、
Events
Page Load
2、
Selectors
Basics
#id
Selects a single element with the given id attribute.
element
Selects all elements with the given tag name.
*
Selects all elements.
selector1, selector2
Selects the combined results of all the specified selectors.
3、
Attributes
Attributes
str.
attr
( name ) | (name , value ) )
1.6*
Get the value of an attribute for the first element in the set of matched elements.
$.
attr
( name, val ), .
attr
( map ), .
attr
( name, fn(index, attr) )
Set one or more attributes for the set of matched elements.
$.
prop
( name )
1.6+
Get the value of a property for the first element in the set of matched elements.
4、
Traversing
Filtering
$.
has
( selector ), .
has
( element )
Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
$.
filter
( selector ), .
filter
( fn(index) )
Reduce the set of matched elements to those that match the selector or pass the function's test.
bool.
is
( selector | function(index) | jQuery object | element )
1.6*
Check the current matched set of elements against a selector and return true if at least one of these elements matches the selector.
$.
map
( fn(index, element) )
Pass each element in the current matched set through a function, producing a new jQuery object containing the return values..
$.
not
( selector ), .
not
( elements ), .
not
( fn( index ) )
Remove elements from the set of matched elements.
$.
slice
( start [, end] )
Reduce the set of matched elements to a subset specified by a range of indices.