jquery Common Tag Records

Source: Internet
Author: User

jquery common Tag Records ajquery finds by Name property
$ ("Div[id]") Select all DIV elements that contain the id attribute
$ ("Input[name= ' keleyicom ')" selects all the name attributes equal to the INPUT element of ' keleyicom '
$ ("input[name!= ' keleyicom ')" selects all the name attribute not equal to ' keleyicom ' INPUT element
$ ("input[name^= ' keleyi ')" selects all the name attributes with the INPUT element beginning with ' keleyi '
$ ("input[name$= ' keleyi ')" selects all the name attributes with the INPUT element ending with ' keleyi '
$ ("input[name*= ' keleyi ')" selects all the name attributes that contain the ' keleyi ' INPUT element
$ ("input[id][name$= ' keleyi ')") can use multiple attributes for federated selection, which is to get all the elements that contain the id attribute and then the property ends with Keleyi
Value by name:
$ ("Input[name= ' mobile ']"). Val ()

twovalue based on ID:

$ ("#mobile_reg_form"). HTML ()
The traversal is evaluated by name:
$ ("Input[name= ' mobile ']"). each (
function () {
Consol.info ($ (this). Val ());
}
)
threeremove input from the form
<script type= "Text/javascript" language= "JavaScript" charset= "UTF-8" >
$ (document). Ready (function () {
var a= $ ("form input");
$. Each (A, function (Name,object) {
Consol.info (name+ ":" + $ (object). val ());
}
);
});
</script>
To get a value (multiple cases):
$ ("Input[name= ' mobile ']") [0].value

$ ("Input[name= ' mobile ']"). Get (1). Value

Fourjquery Add Delete style
To add a style to a label:
$ ("#id"). AddClass ("style");
Delete a label's style:
$ ("#id"). Removeclass ("style");
Note: the "#id" ID is the corresponding label of the Id,style is the name of the corresponding CSS style
Get the selected value from the Radio tab
$ ("Input[name= ' xxxx ']:checked"

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.