Genpact Cora Knowledge Center

Support

Deselect a Radio Button

Use this JavaScript to remove or deselect a radio button selection. In this example, the selection is opt1.

<script type="text/javascript">
<!--
  addFormFieldEventHandler("btn1", "click", function (e)
  {
    //alert("START");
        
    var allRadio1 = document.getElementsByName("opt1");
    
   var x = 0;
    for(x=0; x < allRadio1.length;x++)
    {
      //alert(x);
      allRadio1[x].checked = false;
    }
  });
//-->
</script>