Skip to content
Related Articles
Open in App
Not now

Related Articles

How to unchecked a radio button using JavaScript/jQuery?

Improve Article
Save Article
  • Last Updated : 12 Jan, 2023
Improve Article
Save Article

In order to uncheck a radio button, there is a lot of methods available, but we are going to see the most preferred methods. 

Example 1: This example unchecks the radio button by using Javascript checked property. The JavaScript Radio checked property is used to set or return the checked state of an Input Radio Button. This property is used to reflect the HTML checked attribute. 

html




<h1 style="color:green;">
    GeeksForGeeks
</h1>
  
<input id="radio" type="radio" name="GFG" value="GeeksForGeeks" checked>GFG
  
<br><br>
  
<button onclick="gfg_Run()">
    uncheck
</button>
  
<p id="GFG_DOWN" style="color:green;font-size:20px;"></p>
  
<script>
    var el_down = document.getElementById("GFG_DOWN");
      
    function gfg_Run() {
        var radioButton = document.getElementById("radio");
        radioButton.checked = false;
        el_down.innerHTML = "Unchecked";
    }
</script>


Output:

How to unchecked a radio button using JavaScript/jQuery?

How to unchecked a radio button using JavaScript/jQuery?

Example 2: This example unchecks the radio button by using jQuery prop() method. The prop() method in jQuery which is used to set or return the properties and values for the selected elements. 

html




    <script src=
    </script>
    <h1 style="color:green;">
        GeeksForGeeks
    </h1>
  
    <input id="radio" 
           type="radio" 
           name="GFG" 
           value="GeeksForGeeks" 
           checked>GFG
  
    <br><br>
  
    <button onclick="gfg_Run()">
        uncheck
    </button>
  
    <p id="GFG_DOWN" style="color:green;font-size:20px;"></p>
  
    <script>
        var el_down = document.getElementById("GFG_DOWN");
          
        function gfg_Run() {
            $("#radio").prop("checked", false);
            el_down.innerHTML = "Unchecked";
        }
    </script>


Output:

How to unchecked a radio button using JavaScript/jQuery?

How to unchecked a radio button using JavaScript/jQuery?


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!