Question

<input type="radio" value="10" name="attack" onClick="sendid(this.value)"/> Attack 1
<input type="radio" value="20" name="attack" onClick="sendid(this.value)"/> Attack 2

When I click on the radio, immediately I get the response! But along with the response, I want to clear the check radio! How can I do that?

Was it helpful?

Solution

Set the checked property to false. I suggest passing the element to your function (not just its value):

onClick="sendid(this)"

JavaScript:

function sendid(element){
    element.checked = false;
}

This will work but it doesn't seem like a radio button is the most appropriate tool for this job.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top