You can use the jQuery :checked
selector in combination with the val()
method to find the value of certain radio button inside a group.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<script type="text/javascript"> $(document).ready(function(){ $("input[type='button']").click(function(){ var radioValue = $("input[name='gender']:checked").val(); if(radioValue){ alert("Your are a - " + radioValue); } }); }); </script> |