How To Check A Radio Button When Clicking On Text
erics, Posted May 2nd, 2011 at 10:38:47am
The jQuery
1 2 3 4 |
jQuery('#yourForm label') .live( 'click', function () { jQuery(this).attr('checked','checked'); }); |
The HTML
1 2 3 4 |
<form id="yourForm" method="post" action="/"> <label for="radio1"><input type="radio" name="fruit" value="apple" id="radio1">Click here for Apples</label> <label for="radio2"><input type="radio" name="fruit" value="pear" id="radio2">Click here for Pears</label> </form> |
Leave Your Comment
All fields marked with "*" are required.