Windows – Linux – Mac OSX Guides

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();
Tagged with:     , , ,

Related Articles

Loading Facebook Comments ...

Post your comments

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