1, EQ () filter The elements of the specified index number
2, first () filter out a matching element
3, last () filter out the final matching element
4. Hasclass () checks if the matched element contains the specified class
5. Filter () filters out the collection of elements that match the specified expression
6, is () check whether the elements in the parameters can match the
7. Map ()
8, has () filters out elements containing the specified child elements
9, not () excludes elements that can be matched by parameters
10. Slice () intercepts the specified number of elements starting at the specified index
11, children () filter to get the resource of the specified element
12, closest () starts with the current element and returns the first match to the parent element that matches the condition
13. Find () finds child elements from the specified element
14, Next () gets the next sibling element of the specified element
15. Nextall () gets all of the sibling elements that followed
16, Nextuntil () gets the following element until the argument can match, not including the end condition.
17, Offsetposition () returns the first ancestor element used for positioning, that is, the element position to relative or absolute in the ancestor element.
18, parent () gets the immediate parent element of the specified element
19, parents () gets all the ancestor elements of the specified element, until <body></body>
20, Parentsuntil () gets the ancestor element of the specified element, knowing that the parameters can be matched to the
21, Prev () Gets the previous sibling element of the specified element
22, Prevall () gets all the sibling elements in front of the specified element
23, Prevuntil () gets all the sibling elements in front of the specified element until the conditions in the argument match. Note that the parameter conditions themselves are not matched
24, siblings () gets the sibling element of the specified element, without
25. Add () adds the selected element to the collection of jquery objects
26. Andself () adds itself to the selected jquery collection to facilitate one-time operation
27, End () changes the current selector's selected action back to the previous state.
28, Contents not understand
Filter ************************************
First, EQ () filters The elements of the specified index number
Syntax: the EQ (index|-index) index number starts at 0, and if it is negative, it is counted from the last start and the last from 1 onwards
$ ("P"). EQ (1); If the selector is changed to $ ("P"). EQ (-1), then I am the fourth P will be selected
<div> <p> I am the first p</p> <p> I am the second p</p>//will be selected with an index value of 1 <p> I am the third p</p> <p& gt; I'm a fourth p</p> </div>
Second, first () filter out a matching element
Syntax: First () This method has no parameters
$ ("P"). First (); <div> <p> I am the first p</p>//My index value is 0, I am the first one, I will be selected <p> I am the second p</p> <p> I am the third p</p> <p> I am the fourth p</p> </div>
Third, last () filter out the final matching element
Syntax: Last () This method has no parameters
$ ("P"). Last (); <div> <p> I'm the first p</p> <p> I'm the second p</p> <p> I'm the third p</p> <p> I'm the fourth p</ P> //I am the last one, I will be selected </div>
Iv. hasclass () checks if the matched element contains the specified class
Syntax: Hasclass (Class) class for category name//return Boolean value
if ($ ("P"). Hasclass ("P2"))
{
Alert ("I contain CLASS=P2 elements"); Will pop up, p does exist class= "P2" element
<div> <p> I was the first p</p> <p class= "P2" > I was the second p</p> <p> I was the third p</p> <p> I'm the fourth p</p> </div>
Filter () filters out the collection of elements that match the specified expression
Syntax: Filter (EXPR|OBJ|ELE|FN) expr: Match Expression |obj:jquery object, used to match existing elements | DOM: DOM element for matching | function return value as match condition
$ ("P"). Filter (". P2");
<div> <p> I am the first p</p> <p class= "P2" > I am the second p</p>//I will be selected, my class= "P2" <p> I am the third p& Lt;/p> <p> I am the fourth p</p> </div>
VI, is () check whether the elements in the parameters can match the
Syntax: Is (EXPR|OBJ|ELE|FN) expr: Match Expression |obj:jquery object, used to match existing element | DOM: DOM element for matching | function return value as match condition
$ ($ ("P"). First (). is (". P2"))
{
Alert ("Does not eject because the class of the first p is not equal to P2");
} <div> <p> I am the first p</p> <p class= "P2" > I am the second p</p>//I will be selected, my class= "P2" <p> I am the third A p</p> <p> I was the fourth one p</p> </div>
Vii. map ()
Eight, has () filters out elements containing the specified child elements
Syntax: has (expr|ele) expr: Select Expression | DOM element selection
$ ("div"). has ("P"); <div>//This div will be selected because the DIV contains P sub-elements <p> I am the first p</p> <p class= "P2" > I am the second p</p> <p> I'm the third p</p> <p> I'm the fourth p</p> </div>
<div>
<span> I am a span</spam>
</div>
IX, not () excludes elements that can be matched by parameters
Syntax: not (EXPR|ELE|FN) expr: Select an expression | DOM Element Selection | The role of FN is unclear.
$ ("P"). Not (". P2"); <div> <p> I am the first p</p>//will be selected, no class=p2 <p class= "P2" > I am the second p</p>//will not be selected because there is clas S=p2 excluded by not (". P2") <p> I am the third p</p>//will be selected, no CLASS=P2
<p> I am fourth p</p>//will be selected, no CLASS=P2
</div>
Ten, Slice () intercepts the specified number of elements from the specified index
Syntax: Slice (start, [end]) Start position, end optional, end position, not including end position. If not specified, the match is to the last one.
$ ("P"). Slice (1,3) <div> <p> I am the first p</p>//will not be selected, I index 0 <p class= "P2" > I am the second p</p> Will be selected, I index 1 <p> I am the third p</p>//will be selected, I index 2 <p> I am the fourth p</p>//will not be selected, although my index is 3, but does not include Me </div>
Filter *********************************
Xi. Children () filter the resource that gets the specified element
Syntax: Children (expr); Gets the resource for the specified element, and expr filters the criteria for the child element
$ ("div"). Children (". P2"); <div> <p> I am the first p</p>//will not be selected, although I am a sub-element of Div, but I do not class=p2 <p class= "P2" > I am the second p</p> Will be selected, I am both a child of P and CLASS=P2 <p> I am the third p</p>//will not be selected, although I am a sub-element of Div, but I do not class=p2
<p> I am the fourth p</p>//will not be selected, although I am a sub-element of Div, but I do not class=p2
</div>
12, closest () starts with the current element and returns the first match to the parent element that matches the condition
$ ("span"). Closest ("P", "div"); <div>//Will not be selected, p rob the opportunity <p> I am the first P//p will be selected, because p meets the criteria, and is the first match, although the Div is also eligible, but the DIV is not the first Matched to the. So div is not selected.
<span> I'm span</span> in P.
</p> </div>
13. Find () finds child elements from the specified element
Syntax: Find (Expr|obj|ele) expr: match expression | obj for matching jquery objects | DOM element
$ ("div"). Find (". P2");
<div> <p> I am the first p</p>//will not be selected, although I am a sub-element of Div, but I do not class=p2 <p class= "P2" > I am the second p</p> Will be selected, I am both a child of P and CLASS=P2 <p> I am the third p</p>//will not be selected, although I am a sub-element of Div, but I do not class=p2 <p> I am the fourth P</P&G T Will not be selected, although I am a sub-element of Div, but I do not class=p2 </div>
14, Next () gets the next sibling element of the specified element
Syntax: Next (expr) expr: optional, filter criteria, or null if the next sibling element does not meet the conditions of the change.
$ (". P2"). Next (); If the filter is changed to $ (". P2"). Next (". P4") which is the chosen one? The answer is: no element is selected, because although there is a CLASS=P4 p, it is not. P2 's next. <div> <p> I was the first p</p> <p class= "P2" > I was the second p</p> <p> I was the third p</p> I'm P2 's next <p class= "P4" > I'm fourth p</p> </div>
XV, Nextall () gets all the sibling elements behind
Syntax: nextall (expr) expr: optional, filter criteria to get all sibling elements that follow the expr criteria after
$ (". P2"). Nextall (); If the filter condition is changed to $ (". P2"). Nextall (". P4"); Then I'm the only fourth P will be selected
<div> <p> I was the first p</p> <p class= "P2" > I was the second p</p> <p> I was the third p</p> Will be selected, yes. P2 behind the brother element <p class= "P4" > I am Fourth p</p> //Will be selected, yes. P2 behind the brothers element </div>
16, Nextuntil () gets the following element until the argument can match, not including the end condition.
Syntax: Nextuntil ([Expr|ele][,fil]) expr filter Expression | DOM element filtering, note that the one in the parameter is not included
$ (". P2"). Nextuntil (". P4"); Note This method does not include the. P4
<div> <p> I was the first p</p> <p class= "P2" > I was the second p</p> <p> I was the third p</p> Will be selected, yes. P2 behind the brother element <p class= "P4" > I was the fourth p</p>
17, Offsetposition () returns the first ancestor element used for positioning, that is, the element position to relative or absolute in the ancestor element.
Syntax: Offsetposition () This method has no parameters because the position datum of the absolute positioning of the CSS is relative to the nearest positioned element, so the function of this method is self-evident.
$ ("span"). OffsetParent ();
<div style= "position:relative" >//The div is selected, so the DIV is the positioned element.
<p>
<span> I am a span</span>
</p>
</div>
18, parent () gets the immediate parent element of the specified element
Syntax: the parent (expr) expr is a filter condition, and if the immediate parent element does not meet the criteria, no element is returned (regardless of whether its ancestor has the ability to match expr)
$ ("span"). parent (); <div style= "position:relative" > <p>//I am the immediate parent element of span and I will be matched to <span> I am a span</sp An> </p> </div>
19, parents () gets all the ancestor elements of the specified element, until <body></body>
Syntax: parents (expr) expr is a filter condition and is excluded if an ancestor element does not conform to expr
$ ("span"). Parents (); <div style= "position:relative" >//I am the ancestor of span and I will be matched to it. <body></body> will also be matched to <p> I am the immediate parent element of span and I will be matched to <span> I am a span</span> </p> </div>
20, Parentsuntil () gets the ancestor element of the specified element, knowing that the parameters can be matched to the
Syntax: parentsuntil (expr) expr is a stop parameter that has been matched to expr until the condition of the parameter is not matched.
$ ("span"). Parentsuntil ("div"); <div style= "position:relative" >//I am the ancestor of span, but as a stop condition, I will not be selected <p>//I am the immediate parent element of span and I will be selected <span> I am a span</span> </p> </div>
21, Prev () Gets the previous sibling element of the specified element
Syntax: prev (expr) expr: optional. When the previous sibling element does not meet the criteria in the parameter, no element is returned.
$ (". P2"). Prev (); <div> <p> I am the first p</p>//I will be chosen, I am the last element of the. P2. <p class= "P2" > I was the second p</p> <p> I was the third p</p> <p class= "P4" > I was the fourth one p</p>
22, Prevall () gets all the sibling elements in front of the specified element
Syntax: prevall (expr) expr: optional, excludes all elements that cannot be matched by expr
$ (". P4"). Prevall (". P2"); <div> <p> I am the first p</p>//will not be selected, although I am a. P4 front of the sibling element, but I do not class=p2 <p class= "P2" > I am the second P</P&G T Will be selected, I am both. P4 in front of the sibling element, and I have class=p2 <p> I was the third p</p>//will not be selected, although I am the brother element in front of P4, but I do not have CLASS=P2
<p class= "P4" > I am the fourth p</p>
</div>
23, Prevuntil () gets all the sibling elements in front of the specified element until the conditions in the argument match. Note that the parameter conditions themselves are not matched
Syntax: Prevuntil ([expr|ele][,fil]) expr Match expression | DOM element Matching
$ (". P4"). Prevuntil (". P2"); <div> <p> I am the first p</p>//will not be selected, to P2 stop <p class= "P2" > I am the second p</p>//will not be selected, I am a stop condition, not package including me <p> I am the third p</p>//will be selected, I am in. P2 before, recursion to me in to. P2 <p class= "P4" > I am Fourth p</p>//will not be selected, how could I be my own self What's in front of you? </div>
/******************** Series *******************************/
24, siblings () gets the sibling element of the specified element, without
Syntax: siblings (expr); Expr is a filter condition and does not match the criteria that are not selected
$ (". P2"). siblings (); <div> <p> I am the first p</p>//will be selected, I am. P2 's brother element <p class= "P2" > I am the second p</p>//will not be selected, I am myself <p> I am the third p</p>//will be selected, I am the brother element of the. P2
<p class= "P4" > I am the fourth p</p>//will be selected, I am. P2 's brother Element
</div>
25. Add () adds the selected element to the collection of jquery objects
Add (expr|elements|html|jqueryobject) expr: selector expression | Dom-expression | HTML Fragment | jquery object, the collection of jquery objects together for easy operation;
$ (". P2"). Add ("span"). CSS ("Background-color", "Red"); <div> <p> I was the first p</p> <p class= "P2" > I was the second p</p>//would turn red <p> I was the third P</P&G T <p class= "P4" > I am the fourth p</p> </div>
<span> I am a span</span>//will turn red
26. Andself () adds itself to the selected jquery collection to facilitate one-time operation
Andself () This method has no parameters
$ (". P2"). Nextall (). Andself (). CSS ("Background-color", "Red"); <div> <p> I am the first p</p> <p class= "P2" > I am the second p</p>//will turn red, this is the effect of andself () <P&G t; I am the third p</p>//will turn red <p class= "P4" > I am the fourth p</p>//will turn red </div>
27, End () changes the current selector's selected action back to the previous state.
End () This method has no parameters
$ (". P2"). Next (). End (). CSS ("Background-color", "Red"); <div> <p> I am the first p</p> <p class= "P2" > I am the second p</p>//will turn red, this end () effect <p> I am Three p</p>//does not turn red, although this is selected after the next () method, it is the last because the end () method is rolled back. <p class= "P4" > I am the fourth p</p> </div>
28, Contents not understand