We can uncheck a radio button using JavaScript by making use of the getElementById() method along with targeting the checked property value of an element. We simply need to change the checked property value of the radio button to false. Here is how we can do this:

document.getElementById("radioButton").checked = false;

Let’s see an example of this below.


Lets say we have the following HTML:

Select your favorite mode of transportation:

 





Remove selected radio button Airplane

In this example, we will use the onclick event to call a function uncheckRadio() which we will create below.

The uncheckRadio() function will simply uncheck the last radio button, Airplane.

Here is our function using JavaScript:

function uncheckRadio(){
  document.getElementById("airplane").checked = false;
}; 

Let’s try this out below:

Code Output:

Select your favorite mode of transportation:






Remove selected radio button Airplane

Full Code:

Select your favorite mode of transportation:

 





Remove selected radio button Airplane