Get radio group value with Jquery

Assume you have one radio group name default_lang and you want to know which one is selected

<input name=”default_lang” value=”en” type=”radio” />
<input name=”default_lang” value=”fr” type=”radio” />
<input name=”default_lang” value=”de” type=”radio” />

Well, it’s easy with jQuery

var default_lang = $('input:radio[name=default_lang]:checked').val();

Leave a Comment

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