jquery selector, wildcard [id^= ' Code ']input[id$= ' code '][id*= ' code ']

Source: Internet
Author: User
Tags code tag

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 ')"); // The id attribute contains all the input tags of code

(2) Select by index
// Select all TR labels indexed to even $ (// 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 <a> tags under sub-nodes 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
$ ("#code input:not ([id^= ' Code '])"); // ID is a code tag that does not contain all input tags with id starting with 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, enter

4. Tool functions
$ (' #someField '). Val ($.trim ($ (' #someField '). Val ())); //

Original text reproduced in http://www.cnblogs.com/puzi0315/archive/2013/08/26/3282112.html

jquery selector, wildcard [id^= ' Code ']input[id$= ' code '][id*= ' code ']

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.