1. Gets the check box's selected value
<title> JS Get check box selected value </title><script src= "Jquery-1.11.2.min.js" ></script>class= "ck"/><input type= "checkbox" value= "02"class= "ck"/><input type= "checkbox" value= "03"class= "ck"/><input type= "checkbox" value= "04"class= "ck"/><input type= "checkbox" value= "05"class= "ck"/><input type= "button" value= "Take Check" id= "btn"/><script type= "Text/javascript" > $("#btn"). Click (function(e) {varCK = $ (". CK"); for(vari=0;i<ck.length;i++ ) { if(Ck[i].checked) {alert (Ck[i].value); } } });</script>
Jquery
<title> JQUERY Get check box selected value </title><script src= "Jquery-1.11.2.min.js" ></script>class= "ck"/><input type= "checkbox" value= "02"class= "ck"/><input type= "checkbox" value= "03"class= "ck"/><input type= "checkbox" value= "04"class= "ck"/><input type= "checkbox" value= "05"class= "ck"/><input type= "button" value= "Take Check" id= "btn"/><script type= "Text/javascript" > $("#btn"). Click (function(e) {varCK = $ (". CK"); for(vari=0;i<ck.length;i++ ) { if(Ck.eq (i). Prop ("checked")) {alert (CK. EQ (i).Val ()); } } });</script>
2. JQUERY take the selected value of the Radio box
<title> JQUERY check box selection </title><script src= "Jquery-1.11.2.min.js" ></script>class= "RD" Name= "a"/><input type= "Radio" value= "02"class= "RD" Name= "a"/><input type= "Radio" value= "03"class= "RD" Name= "a"/><input type= "Radio" value= "04"class= "RD" Name= "a"/><input type= "Radio" value= "05"class= "RD" Name= "a"/><input type= "button" value= "Take a single select" Id= "B2"/><script type= "Text/javascript" > $("#b2"). Click (function(e) {varB = $ (". Rd"); for(vari=0;i<b.length;i++) { if(B.eq (i). Prop ("checked")) alert (B. EQ (i).Val ()); } });</script>
3. JQUERY Take the check box to select the value, here can not use attr (), there will be a bug, so the prop () property is used, and then the state of its own check box
<title>jquery check box selected value </title><script src= "Jquery-1.11.2.min.js" ></script>Select All<input type= "checkbox" value= "01"class= "ck"/>01<input type= "checkbox" value= "02"class= "ck"/>02<input type= "checkbox" value= "03"class= "ck"/>03<input type= "checkbox" value= "04"class= "ck"/>04<input type= "checkbox" value= "05"class= "ck"/>05<input type= "button" value= "Take multiple Select" Id= "btn"/><script type= "Text/javascript" > $("#qx"). Click (function(e) {varXZ = $ (this). Prop ("Checked"); $(". CK"). Prop ("Checked",XZ); });</script>
4.JQUERY Gets the selected value of the drop-down list
<title> JQUERY Gets the selected value of the drop-down list </title><script src= "Jquery-1.11.2.min.js" ></script> $ ("#b1"). Click ( function(e) { alert ($ ("#sel"). Val ()); }); </script>
Jquery Read form Check value