May 30, 2021 Article blog
Wildcards in jQuery's selectors
(1) Wildcards:
$ ("INPUT ^ = 'code'); // id attribute All input labels started by Code
$ ("INPUT [ID $ = 'code'); // id attributes all INPUT tags ended in CODE
$ ("INPUT [ID * = 'code'); // id attribute includes all INPUT tags for Code
(2) Select according to the index
$ ("INPUT ^ = 'code'); // id attribute All input labels started by Code
$ ("INPUT [ID $ = 'code'); // id attributes all INPUT tags ended in CODE
$ ("INPUT [ID * = 'code'); // id attribute includes all INPUT tags for Code
(3) The number of inputs that have obtained the next level node of jQueryObj
jqueryObj.children("input").length;
(4) All < a > labels under the child node of the label that gets class as >
$(".main > a");
(5) Select the label immediately next to it
jQueryObj.next ("DIV"); // Get 1 DIV next to the jQueryObj tag, NEXTALL gets all
not
$ ("# code INPUT: NOT ([ID ^ = 'code'])") "); // ID does not include all Id labels starting with CODE tags
/ / Treat the keyboard operation on the text box
jqueryObj.keyup(function(event){
Var keycode = event.which; // Get the key value of the current pressing keyboard, the Enter key is 13
}
$ ('# somefield'). Val ($. TRIM ($ ('# somefield'). Val ())); // Eliminate space, syntax: $. Trim (Value)
There's more jQuery teaching at: jQuery tutorials
jQuery Beginner Video Course: Little White Front End: jQuery Beginner
And as well as learning and practicing: jQuery micro-classes