Operation |
Instance |
Effect |
Note |
Add to |
Add Selector |
$ ("P"). Add (". a") |
To add a selector with the class name a |
Does not affect the source result set |
$ ("P"). Add ("Label", $ (". Class")); |
Add class contains selectors for all label elements named class |
Adding HTML objects |
$("P"). Add( document. getElementsByTagName("label")) |
Add an HTML object with an element name of label |
Add a JQuery Object |
$ ("P"). Add ($ ("strong")) |
Add a jquery object with an element named Strongl |
Screening |
Get element |
$ ("P"). First () |
Gets the first element |
|
$ ("P"). Last () |
Gets the last element |
|
$ ("P"). EQ (3) |
Gets the 3rd element |
can be negative, table countdown |
Get subset |
$ ("P"). Slice (2) |
Gets the result set of the 2nd element up to the end of the result set |
|
$ ("P"). Slice (2,5) |
Get a result set consisting of 第2-5个 elements |
|
Filter Current |
Get the corresponding element |
$ ("P"). Filter (". AA") |
Get a result set containing the class name AA |
|
$ ("div"). Filter (document. getElementsByTagName("label")) |
Get the result set that contains the LABEL element |
|
$ ("div"). Filter ($test) |
Get the result set containing the $test object |
|
$ ("div"). Filter (function (index) {if (this.id== "Xixi") {return true;} Else{return false;}} ) |
Traverse result set, get false return value to reject |
Index is indexed, this represents the current object |
Remove the corresponding element |
$ ("P"). Not (". AA") |
|
Just the opposite of filter |
$ ("div"). Not (document. getElementsByTagName("label")) |
|
$ ("div"). Not ($test) |
|
$ ("div"). Not (function (index) {}) |
|
later generation |
Get the result set containing the descendant elements that match the criteria |
$ ("div"). has (". AA") |
Descendants contain a result set with the class name AA |
The object that is judged is the descendant element |
$ ("div"). has (document. getElementsByTagName("label")) |
Descendants contain a result set with the element name label |
Detection |
Returns TRUE or False |
$ ("#div1"). Is ("div") |
Returns True when the parameter is the parent set of the source result set |
|
$ ("#div1"). Is (document. getElementsByTagName("div")) |
$ ("#div1"). Is ($test) |
$ ("#div1"). Is (function (index) {if (this.id== "Xixi") {return true;} Else{return false;}}) |
Index is indexed, this represents the current object |