Web Tools Table Maker3schools TranslateImage CompressorFavicon Icon GeneratorCrop & Resize Image
Apu
Apu January 19, 2023 › #HowTo #Javascript

How to unchecked a radio button in JavaScript

In this article, we will discuss how to unchecked a radio button using JavaScript.

To unchecked a radio button, we can use the JavaScript checked property.

Syntax #

myRadio.checked = false;

The checked property Specifies whether a checkbox should be checked or not.

true - The checkbox is checked.
false - The checkbox is not checked (default).

Click on the button to open the code in our online editor.

<input id="radio" type="radio" checked>
  
<button onclick="myFunction()">
    Uncheck
</button>
<script>  
 function myFunction() {
  const radioButton = document.querySelector('#radio');
        radioButton.checked = false;
  }
</script>
save
listen
AI Answer
Write Your Answer
loading
back
View All