---
title: "How can I know which radio button is selected via jQuery?"  
description: "How can I know which radio button is selected via jQuery?"  
author: "Utpal Vishwas"  
published: 2023-08-29  
updated: 2023-09-02  
canonical: https://www.mindstick.com/forum/159725/how-can-i-know-which-radio-button-is-selected-via-jquery  
category: "jquery"  
tags: ["jquery", "jquery ui", "jquery selectors", "radiobutton"]  
reading_time: 2 minutes  

---

# How can I know which radio button is selected via jQuery?

How can I know which [radio button](https://www.mindstick.com/articles/12743/radio-button-in-android) is selected via jQuery?

## Replies

### Reply by Aryan Kumar

Sure, I can help you with that.

To know which radio [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) is selected via jQuery, you can use the `:checked` selector. The `:checked` selector selects all radio buttons that are checked.

The following code shows how to know which radio button is selected via jQuery:

```plaintext
// Get the radio button element.
var radioButton = $("#myRadioButton");

// Check if the radio button is checked.
var isChecked = radioButton.is(":checked");
```

In this code, the `radioButton` variable is the jQuery object for the radio button element. The `is(":checked")` method is used to check if the radio button is checked.

If the radio button is checked, the `isChecked` variable will be `true`. If the radio button is not checked, the `isChecked` variable will be `false`.

You can also use the `val()` method to get the value of the selected radio button. The following code shows how to get the value of the selected radio button:

```plaintext
// Get the value of the selected radio button.
var radioButtonValue = radioButton.val();
```

In this code, the `radioButtonValue` variable is the value of the selected radio button.


---

Original Source: https://www.mindstick.com/forum/159725/how-can-i-know-which-radio-button-is-selected-via-jquery

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
