How to know which radio button is selected using jQuery? Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report To check which radio button is selected in a form, we first get the desired input group with the type of input as an option and then the value of this selection can then be accessed by the val() method. This returns the name of the option that is currently selected. The selector 'input[name=option]:checked' is used to select all input groups that have the option type of input in the specified form. Syntax: $('input[name=option]:checked', 'formName').val() This is shown in the example below. Example: html <!DOCTYPE html> <html> <head> <title> How to know which radio button is selected via jQuery? </title> </head> <body> <h1 style="color: green"> GeeksForGeeks </h1> <b> How to know which radio button is selected via jQuery? </b> <p> <form id="myForm"> <label> <input type="radio" name="option" value="free"> Free Membership </label> <label> <input type="radio" name="option" value="premium"> Premium Membership </label> </form> <p> The value of the option selected is: <span class="output"></span> </p> <button id="btn"> Check option button </button> <script src= "https://code.jquery.com/jquery-2.2.4.min.js"> </script> <script type="text/javascript"> // Check the radio button value. $('#btn').on('click', function() { output = $('input[name=option]:checked', '#myForm').val(); document.querySelector( '.output').textContent = output; }); </script> </body> </html> Output: Check after clicking on the first option: Check after clicking on the second option: jQuery is an open source JavaScript library that simplifies the interactions between an HTML/CSS document, It is widely famous with it's philosophy of “Write less, do more". You can learn jQuery from the ground up by following this jQuery Tutorial and jQuery Examples. Comment More infoAdvertise with us Next Article How to make a Mini size Radio Button using jQuery Mobile ? S sayantanm19 Follow Improve Article Tags : Web Technologies JQuery jQuery-Misc Similar Reads How to make a Themed Radio Button using jQuery Mobile ? jQuery Mobile is a web based technology used to make responsive content that can be accessed on all smartphones, tablets and desktops. In this article, we will be creating a Themed Radio Button using jQuery Mobile. Approach: Add jQuery Mobile scripts needed for your project. <link rel=âstylesheet 1 min read How to get value of selected radio button using JavaScript ? To get the value of the selected radio button, a user-defined function can be created that gets all the radio buttons with the name attribute and finds the radio button selected using the checked property. The checked property returns True if the radio button is selected and False otherwise. If ther 2 min read How to make a Mini size Radio Button using jQuery Mobile ? jQuery Mobile is a web-based technology used to make responsive content that can be accessed on all smartphones, tablets and desktops. In this article, we will be creating a Mini size Radio Button using jQuery Mobile. Approach: Add jQuery Mobile scripts needed for your project. <link rel=âstylesh 1 min read How to calculate the sum of radio button values using jQuery ? In this article, we will see how to calculate the sum of radio button values using jQuery. To add the values of radio buttons, we will use the addition arithmetic operator. Approach: First, we will use radio buttons to select two numbers i.e. number1 and number2. If the user clicks on the radio butt 2 min read How to unchecked a radio button using JavaScript/jQuery? In order to uncheck a radio button, there are a lot of methods available, but we are going to see the most preferred methods. In HTML, we can create radio buttons using the same name attribute, and by setting a unique value for each radio button within the group. Only one radio button within the gro 2 min read How to check a radio button with jQuery? There are two methods by which one can dynamically change the currently selected radio button by changing the checked property of the input type. Method 1: Using prop method: The input can be accessed and its property can be set by using the prop method. This method manipulates the 'checked' propert 3 min read Like