jquery radiogroup get checked value code example

Example 1: jquery get value of radio input

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

Example 2: radio button group html jquery

<input type="radio" id="radio1" name="RadioGroup1" value="1" checked="true"/>
<input type="radio" id="radio2" name="RadioGroup1" value="2" />
<input type="radio" id="radio3" name="RadioGroup1" value="3" />


//in your jquery
var value = $("input[name=RadioGroup1]:checked").val();

alert("The user selected; " + value);

Tags:

Html Example