get selected radio button value using jquery
get selected radio button value using jquery
by Alex Azuero
HTML
<form id="myForm">
<input type="radio" name="myRadio" value="1" /> 1 <br />
<input type="radio" name="myRadio" value="2" /> 2 <br />
<input type="radio" name="myRadio" value="3" /> 3 <br />
</form>
CSS
/*visit www.coding-issues.com for more posts on JQuery*/
JavaScript
$('#myForm input').on('change', function() {
alert($('input[name="myRadio"]:checked', '#myForm').val());
});
//for more details visit www.coding-issues.com