jQuery 学习列表
1、
Events
Page Load
$. ready ( fn() )
Specify a function to execute when the DOM is fully loaded.
2、
Selectors
Basics
#id
Selects a single element with the given id attribute.
element
Selects all elements with the given tag name.
.class, .class.class
Selects all elements with the given class.
*
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.
$. removeAttr ( name )
Remove an attribute from each element in 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.
$. removeProp ( name ) 1.6+
Remove a property for the set of matched elements.
4、
Traversing
Filtering
$. eq ( index )
Reduce the set of matched elements to the one at the specified index.
$. first ( )
Reduce the set of matched elements to the first in the set.
$. last ( )
Reduce the set of matched elements to the final one in the set.
$. 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.
标签:jQuery,selector,elements,name,列表,学习,set,element,matched From: https://blog.51cto.com/u_16179085/6663477