How to display value of radio button in button click event using jQuery?

Are you new user to jQuery? Then this code snippet will be useful for you. I have provided a very basic jQuery script for obtaining the value of a radio button which the user has selected on the click of submit button.

jQuery is a very lightweight library with the help of it you do the simple selections of DOM elements on your page.

In this example I have shown how to display value of radio button in button click event using jQuery.

Add HTML page in your .Net application. Please make sure that jquery-1.4.1.js exists in your application else you can download it using internet.

<!DOCTYPE html>
<html xmlns="">
<title>Radio button Value</title>
<script src ="Scripts/jquery-1.4.1.js" type ="text/javascript">

<script type ="text/javascript">
$(document).ready(function () {
$("button").click(function () {
alert("Value is " + $("#rdoVal").val());
<p>Select this: <input type="radio" id="rdoVal" value="Radio button one" >Radio button one</p>

You can view this HTML page in browser or you can run .Net application to view the output. After clicking on Submit button, you will get value of alert as "Value is Radio button one" at run time.


No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: