1. Selector
(1) wildcard characters:
$ ("input[id^= ' Code ')");//id attribute all input tags starting with code
$ ("input[id$= ' Code ')");//id attribute all input tags ending with code
$ ("input[id*= ' Code ')");//id property contains all input tags for code
$ ("input[name^= ' Code ')");//name attribute all input tags starting with code
$ ("input[name$= ' Code ')");//name attribute all input tags ending with code
$ ("input[name*= ' Code ')");//name property contains all input tags for code
$ ("input[name*= ' Code ')"). each (Fuction () {
var sum=0;
if ($ (this). val () = "") {
Sum=parseint (SUM) +parseint ($ (this). Val ());
}
$ ("#"). Text (sum);
})
(2) Select by index
$ ("tbody Tr:even"); Select all TR labels indexed to even
$ ("tbody tr:odd"); Select all TR labels with an odd index
(3) Get the number of input of Jqueryobj next level node
Jqueryobj.children ("input"). Length;
(4) Get all tags under the child node of the tag class main
$ (". Main > a");
(5) Select next to label
Jqueryobj.next ("div");//Gets the jqueryobj tag immediately after the next div,nextall gets all
2. Filters
Not
$ ("#code input:not ([id^= ' code])");//id is a code tag that does not contain all input tags that start with the ID code
3. Events
Working with keyboard actions on a text box
Jqueryobj.keyup (function (event) {
var keycode = event.which;//Gets the key value of the currently pressed keyboard, the Enter is 13
}
4. Tool functions
$ (' #someField '). Val ($.trim ($ (' #someField '). Val ()));//Clear space, Syntax: $.trim (value)
Wildcard character in the selector of query [id^= ' code '] or [name^= ' code ']