<form class="responses">
<input type="radio" name="choice" value="0">False</input>
<input type="radio" name="choice" value="1">True</input>
</form>
Have tried:
$('[name="choice"]').is(':checked'))
If either is checked it returns true, if neither is checked returns false, but I need to see which one is checked.
I am creating choices dynamically, and am not giving each an ID.
The following code will give the value of the checked radio button. If nothig is checked it will give undefined. Put this snippet inside a function and call the function on checking radio button
$("input[name='choice']:checked").val()
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments