---
title: "Check the Radio button with the help of an jQuery"  
description: "Check the Radio button with the help of an jQuery"  
author: "Ethan Karla"  
published: 2021-07-28  
updated: 2023-11-26  
canonical: https://www.mindstick.com/forum/156644/check-the-radio-button-with-the-help-of-an-jquery  
category: "jquery"  
tags: ["jquery"]  
reading_time: 1 minute  

---

# Check the Radio button with the help of an jQuery

How to [check](https://yourviews.mindstick.com/story/2248/never-forget-to-check-these-specifications-before-buying-a-mobile-phone) the [Radio button](https://www.mindstick.com/articles/12743/radio-button-in-android) with the help of an jQuery?

## Replies

### Reply by Aryan Kumar

To check a radio [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) using jQuery, you can use the **prop()** method to set the **checked** property to **true**. Here's an example:

```plaintext
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Check Radio Button with jQuery</title>
  <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
</head>
<body>

<label>
  <input type="radio" name="gender" value="male"> Male
</label>

<label>
  <input type="radio" name="gender" value="female"> Female
</label>

<button id="checkMale">Check Male</button>
<button id="checkFemale">Check Female</button>

<script>
  $(document).ready(function() {
    // Check the male radio button
    $('#checkMale').on('click', function() {
      $('input[name="gender"][value="male"]').prop('checked', true);
    });

    // Check the female radio button
    $('#checkFemale').on('click', function() {
      $('input[name="gender"][value="female"]').prop('checked', true);
    });
  });
</script>

</body>
</html>
```

In this example:

- Two radio buttons with the same **name** attribute create a radio button group.
- The "Check Male" and "Check Female" buttons have IDs (**checkMale** and **checkFemale**) and are associated with click events.
- When the buttons are clicked, the corresponding radio button is checked using the **prop('checked', true)** method.

This example demonstrates how to programmatically check a radio button using jQuery. Adjust the code based on your specific HTML structure and requirements.


---

Original Source: https://www.mindstick.com/forum/156644/check-the-radio-button-with-the-help-of-an-jquery

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
