Please advise, how to uncheck the radio button using javascript? I have checked similar questions but could not figure it out.
function uncheck1(){
let chkstatus = document.getElementById("radiobtn1").checked;
if (chkstatus==true) {
document.getElementById("radiobtn1").checked = false;
} else if (chkstatus==false){
document.getElementById("radiobtn1").checked = true;
}
}
<input onclick="uncheck1()" id="radiobtn1" name="grp1" type="radio" value="prashant">prashant</input>
After click the condition is true and script is setting value to false so value is not getting selected at all. Please advise where exactly modification required?