How to Get Value of Radio button group using jQuery?

After jQuery comes into the programming world we just started love to programming because of its simplicity and quality.

Lets see how can we retrive the value of a radio button group.

See the piece of code will get the selected value from a radio group:


Here is the example program for you to understand the workflow:

<title>How to get the value of selected radio button group</title>
<script src=""></script>
<script type="text/javascript">
$('#check').click(function() {
var oneval = $("input:radio[name='one']:checked").val();
var twoval = $("input:radio[name='two']:checked").val();

alert('First value is '+oneval+', Second value is '+twoval);



<form name="form" method="post" action="">
Question 1<br/>
<input type="radio" name="one" value="1"/> Ans1
<input type="radio" name="one" value="2"/> Ans2
<input type="radio" name="one" value="3"/> Ans3
Question 2<br/>
<input type="radio" name="two" value="1"/> Ans1
<input type="radio" name="two" value="2"/> Ans2
<input type="radio" name="two" value="3"/> Ans3

<input type="button" value="Test" id="check" />

Add a Comment

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