Check Data frame
<! DOCTYPE html Public"-//w3c//dtd XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >Botanical Gardens<input type= "checkbox"class= "CK" value= "Botanical Garden"/>Parks<input type= "checkbox"class= "CK" value= "Park"/>Hospital<input type= "checkbox"class= "CK" value= "Hospital"/>Restaurant<input type= "checkbox"class= "ck" value= "Restaurant"/></div><br/><div><input type= "button" value= "Take Value" id= "BTN"/></div ><BR/><div>Please enter a region: <input type= "text" id= "qy"/><input type= "button" value= "Settings Select" id= "Szxz"/></div></body>< Script type= "Text/javascript" >$ (document). Ready (function(e) {$ ("#qx"). Click (function(){ //find selection of the Select All button varxz=$ (This). Prop ("Checked"); //selects all of the check boxes in the check box list to select All selected states$ (". CK"). Prop ("Checked",XZ); }) $("#btn"). Click (function(){ varck=$ (". CK")); for(vari=0;i<ck.length;i++) { //take the jquery object//ck.eq (i). Prop ("checked"); Fetch DOM Object//ck[i].checked if(Ck.eq (i). Prop ("checked")) {alert (CK. EQ (i).Val ()); } } }) $("#szxz"). Click (function(){ //gets the value entered by the user varqy=$ ("#qy").Val (); //Set the selected varck=$ (". CK")); CK. Prop ("Checked",false); for(vari=0;i<ck.length;i++) { if(Ck.eq (i). val () = =qy) {CK. EQ (i). Prop ("Checked",true); } } }) });</script>View CodeSingle-Selection data frame
<! DOCTYPE html Public"-//w3c//dtd XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >Botanical Gardens<input type= "Radio" name= "QY"class= "CK" value= "Botanical Garden"/>Parks<input type= "Radio" name= "QY"class= "CK" value= "Park"/>Hospital<input type= "Radio" name= "QY"class= "CK" value= "Hospital"/>Restaurant<input type= "Radio" name= "QY"class= "ck" value= "Restaurant"/></div><br/><div><input type= "button" value= "Check value" id= "BTN"/></div ></body><script type= "Text/javascript" >$ (document). Ready (function(e) {$ ("#btn"). Click (function(){ varck=$ (". CK")); //using the For loop output for(vari=0;i<ck.length;i++) { if(Ck.eq (i). Prop ("checked")) {alert (CK. EQ (i).Val ()); } } })});</script>View CodeDrop-down Data bar
<! DOCTYPE html Public"-//w3c//dtd XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >Please enter:<input type= "text" id= "zhi"/><input type= "button" value= "Settings Check" id= "Szxz"/></div></body>< Script type= "Text/javascript" >$ (document). Ready (function(e) {$ ("#btn"). Click (function() {alert ($ ("#qy").Val ()); }) $("#szxz"). Click (function(){ varzhi=$ ("#zhi").Val (); varop=$ ("option"); /*For (Var i=0;i<op.length;i++) {//op.eq (i). Prop ("selected"); if (Op.eq (i). Val () ==zhi) {Op.eq (i). Prop ("selected", true); } }*/ $("#qy").val (zhi); })});</script>View CodeJQ full selection setting and setting selected