1. Selector
(1) wildcard characters:
Copy Code code as follows:
$ ("input[id^= ' Code ']");//id all input tags starting with code
$ ("input[id$= ' Code ']");//id all input tags that end with the code
$ ("input[id*= ' Code ']");//id property contains all input labels for code
(2) According to the index selection
Copy Code code as follows:
$ ("tbody Tr:even"); Select all TR tags with an even-numbered index
$ ("tbody tr:odd"); Select all TR tags with an odd index
(3) To obtain the number of input for the next level node of Jqueryobj
Copy Code code as follows:
Jqueryobj.children ("input"). Length;
(4) Get all <a> tags under the child node of the label with class main
Copy Code code as follows:
(5) Select adjacent label
Copy Code code as follows:
Jqueryobj.next ("div");//Get the jqueryobj tag immediately after a div,nextall fetch all
2. Filters
Copy Code code as follows:
Not
$ ("#code input:not ([id^= ' Code '])"//id for all input tags within the code tag that do not contain IDs starting with code
3. The event
Copy Code code as follows:
Working with keyboard actions on a text box
Jqueryobj.keyup (function (event) {
var keycode = event.which;//Gets the key value that is currently pressed on the keyboard, enter 13
}
4. Tool function
Copy Code code as follows:
$ (' #someField '). Val ($ (' #someField '). Val ());//Eliminate spaces, Syntax: $.trim (value)