jQuery get which radio is selected

Use the :checked selector along with the radio selector.
With form id, can do this

$('input[name=radioName]:checked', '#myForm').val();

//or

$("#myform input[type='radio']:checked").val();

Without form is, it will still work:

$('input[name=radioName]:checked').val();

By Keenlio, August 22, 2014

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *


4 + one =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>