Check Radio Button Using jQuery
home
Run
screen_rotation
fullscreen
cloud_download
<!DOCTYPE html> <html> <head> <title>jQuery Demo example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"> </script> <script type="text/javascript"> function checkRadio(){ $("#radio2").prop("checked", true); } </script> </head> <body> <form> <input type='radio' id='radio1' name='type' value='1' /> <input type='radio' id='radio2' name='type' value='2' /> <input type='radio' id='radio3' name='type' value='3' /> </form> <button onclick="checkRadio()">Check Radio</button> </body> </html>
<!DOCTYPE html> <html> <head> <title>jQuery Demo example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"> </script> <script type="text/javascript"> function checkRadio(){ $("#radio2").prop("checked", true); } </script> </head> <body> <form> <input type='radio' id='radio1' name='type' value='1' /> <input type='radio' id='radio2' name='type' value='2' /> <input type='radio' id='radio3' name='type' value='3' /> </form> <button onclick="checkRadio()">Check Radio</button> </body> </html>
Copyrights@tutorialsplane.com