jquery Wildcard Filter Event tool function

Source: Internet
Author: User
Tags code tag

(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 The//id property contains all input tags of code [property name] matches the element containing the given property [Att=value] matches the element containing the given attribute (case sensitivity) [att*=value] Fuzzy match [att!=value] cannot be this value [ Att$=value] End is this value [Att^=value] starts with this value [ATT1][ATT2][ATT3] ... Match one of the multiple attribute conditions

  

(2) Select by index
$ ("tbody Tr:even"); Select all TR tags indexed to even numbers $ ("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
Handles the keyboard action on the 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)

jquery Wildcard Filter Event tool function

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.