jquery Radio checked CheckBox value deletion increase multiple (1/2)

Source: Internet
Author: User
<script type= "text/web Effects" >
$ (document). Ready (function () {
Get the value of RadioButtonList
$ ("#btngetradiobuttonlistvalue"). Click (function () {
if ($ ("input[type=radio]:checked"). val () = null) {
Alert ("Please select");
return false;
}
Alert ($ ("input[type=radio]:checked"). Val ());
});
Gets the value of the HTML radio
$ ("#btngetradiovalue"). Click (function () {
if ($ ("Input[name= ' Radioselect ']:checked"). val () = null) {
Alert ("Please select");
return false;
}
Alert ($ ("Input[name= ' Radioselect ']:checked"). Val ());
});
Get the value of a checkbox
$ ("#btngetcheckboxvalue"). Click (function () {
var values = "";
$ ("Input[name= ' Chkselect ']"). each (function () {
if ($ (this). attr ("checked")) {
Values + = $ (this). Val () + ",";
}
});
if (values = = "") {
Alert ("Please select");
return false;
}
Values = values.substring (0, values.length-1); Remove the tail,
alert (values);
});
Select All
$ ("#btnselectallon"). Click (function () {
$ ("Input[name= ' Chkselect ']"). each (function () {
$ (this). attr ("Checked", true);
});
});
Return
$ ("#btnselectalloff"). Click (function () {
$ ("Input[name= ' Chkselect ']"). each (function () {
$ (this). attr ("checked", false);
});
});
Get the value of multiple
$ ("#btngetmultiplevalue"). Click (function () {
var values = "";
$ ("#multiple1 option:selected"). each (function () {
Values + = $ (this). Val () + ",";
})
Values = values.substring (0, values.length-1); Remove the tail,
alert (values);
});
Option to add multiple
$ ("#btnaddmultipleoption"). Click (function () {
$ ("#multiple1"). Append ("<option value= ' ax ' >ax</option>");
});
Remove multiple selected option
$ ("#btnremovemultipleoption"). Click (function () {
$ ("#multiple1 option"). Remove ("option:selected");
});
Get the value of a select
$ ("#btngetselectvalue"). Click (function () {
Alert ($ ("#select1 option:selected"). Val ());
});
Option to add Select
$ ("#btnaddselectoption"). Click (function () {
$ ("#select1"). Append ("<option value= ' bx ' >bx</option>");
});
Remove Select option
$ ("#btnremoveselectoption"). Click (function () {
$ ("#select1 option"). Remove ("option:selected");
});
});
</script>

Home 1 2 last page

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.