jquery Gets the value from the input label's name

Source: Internet
Author: User
jquery finds $ ("Div[id]") based on the Name property and selects all div element $ ("Input[name= ' keleyicom") with ID attributes to select all the input elements of the Name property equal to ' keleyicom ' $ (" Input[name!= ' keleyicom '] Select all the name attributes that are not equal to ' keleyicom ' ("input[name^= ' keleyi ']") to select all the "Keleyi" The initial INPUT element $ ("input[name$= ' keleyi ')") selects all of the name attributes with an INPUT element ending with ' keleyi ' ("input[name*= ' keleyi ')")
Select all of the name attributes containing the ' keleyi ' INPUT element $ ("input[id][name$= ' keleyi ')" To use multiple properties for the federated selection, which is to get all elements that have the id attribute and then the attribute ends at Keleyi Value based on name: $ ("input[name= ' mobile ']"). Val () is based on the ID: $ ("#mobile_reg_form"). html () takes a value based on name traversal: $ ("Input[name= ' m  

Obile ']). each (function () {Alert ($ (this). Val ()); Remove input from form: <script type= "Text/javascript" language= "JavaScript" charset= "UTF-8" > $ (document). Re    
Ady (function () {var a=$ ("form input");    
$.each (A, function (name,object) {alert (name+ ":" +$ (Object). val ());    
}    
);    
}); </script> Get Value (multiple cases): $ ("input[name= ' mobile ']") [0].value $ ("Input[name= ' mobile ']"). Got (1). VALue-----jquery Add a Delete style--------add a style to a label: $ ("#id"). AddClass ("style");  
Deletes the style of a label: $ ("#id"). Removeclass ("style"); Note: the "#id" ID is corresponding to the label Id,style is the corresponding CSS style name gets the radio label selected to obtain the value $ ("Input[name= ' xxxx ']:checked"). Val ();

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.