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).
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
How to unchecked a radio button in JavaScript
0
In this article, we will discuss how to unchecked a radio button using JavaScript. To unch…
asked
Apu
0 answers
2915
In this article, we will discuss how to unchecked a radio button using JavaScript. To unch…
Answer Link
answered
Apu
