JQuery wildcard characters

Source: Internet
Author: User
Tags code tag

Wildcard characters:

$("input[id^= ' code ']");//id All input tags with the Code start property$("input[id$= ' code ']");//id All input tags with the code end attribute$("input[id*= ' code ']");The//id property contains all the input tags of code$("input[name^= ' code ']");//name All input tags with the Code start property$("input[name$= ' code ']");//name All input tags with the code end attribute$("input[name*= ' code ']");The//name property contains all the input tags of code$("input[name*= ' code ']"). each (Fuction () {varsum=0;if($( This). val () = "" ") {sum=parseint(SUM) +parseint($( This). Val ()); }    $("#"). Text (sum);})

Select by index

$ ("tbody tr:even//Select all TR labels with an even index of $ ("tbody tr:odd//Select all TR labels with an odd index

Get the input number of the next level node of Jqueryobj

Jqueryobj.children ("input"). length;

Get all tags under the child node of the tag class main

$ (". Main > A");

Select Close Tag

Jqueryobj.next ("div"); //Get the jqueryobj tag immediately after the next div,nextall get all

Filter

$ ("#code input:not ([id^= ' Code '])"); //id All input tags that do not contain an ID at code start in the code tag

Event

Jqueryobj.keyup (function(event) {  var keycode = Event.which;  Gets the key value of the currently pressed keyboard, the Enter number is}$ (' #someField '). Val ($.trim ($ (' #someField '). Val ())); //Remove spaces, Syntax: $.trim (value)

JQuery wildcard characters

Related Article

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.