Wildcard characters in the jquery selector [id^= ' code '] or [name^= ' code ']

Source: Internet
Author: User

1. Selector
(1) wildcard characters:
("input[id^= ' Code ']");//id all input tags ("input[id^= ' Code") starting with code;//id all Input tags ("input[id =′code′]" that start with the code. ;//id property with all input tags ending with code = ' Code '];//id property with all input tags ("input[id*= ' Code") ending with code;//id property contains all input tags for code
("input[name^= ' Code ']");//name all input tags ("input[name^= ' Code") that start with code,//name all input tags that start with code ("Input[name =′code′] "");//name property with all input tags ending with code = ' Code '];//name property to all input tags ending with code ("input[name*= ' Code ')"); The Name property contains all input labels for code
("input[name*= ' Code ']"). each (Fuction () {
var sum=0;
if ($ (this). Val ()!= "") {
Sum=parseint (SUM) +parseint ($ (this). Val ());
}
$ ("#"). Text (sum);
})
(2) Depending on index selection ("input[name*= ' Code ')"). each (Fuction () {var sum=0; if ($ (this). Val ()!= "") {sum=parseint (sum) +parseint ( This). Val ()); } $ ("#"). Text (sum); }) (2) According to index selection ("Tbody tr:even"); Select all TR tags with an even-numbered index
("tbodytr:odd")//Select all TR tags (3) with odd indices to obtain the input number Jqueryobj.children ("input") of the Jqueryobj Next level node. length; (4) Get class for Mai

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.