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

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -