html - Get radio checked in an array in jquery -
i got next html code , want array of checked radio buttons:
<tr> <td>¿cómo te llamas?</td> <td><input class="radio" type="radio" name="respuesta1" value="female"> pablo</td> <td><input class="radio" type="radio" name="respuesta1" value="female"> christian</td> <td><input class="radio" type="radio" name="respuesta1" value="female"> alberto</td> </tr> <tr> <td>¿cuánto es 2 + 2?</td> <td><input class="radio" type="radio" name="respuesta2" value="female"> 2</td> <td><input class="radio" type="radio" name="respuesta2" value="female"> 3</td> <td><input class="radio" type="radio" name="respuesta2" value="female"> 4</td> </tr>
as can see, there arte 2 questions want checked radios in jquery array correct answers. can please me?
i think might work
$(".radio:checked").each(function() { console.log($(this).val()); });
Comments
Post a Comment