Search code examples
javascriptxslt

How to uncheck radio button javascript


I have the below radio button. When it is clicked it is not possible to clear the radio button.

the code is

<td class="Label">
<input class="Label" type="radio" name="reviewoptions_{@id}" value="other" onClick="reAssign({count(../bankguaranteedata)},document.lending.guaranteereviewoptions,this,{@id})">
<xsl:if test="guaranteereviewoptions/reviewoptions[@id='other']='checked'">
<xsl:attribute name="checked"/>
</xsl:if>
</input>Other</td>

is it possible that when its clicked again it will clear the radio button?


Solution

  • It is not possible to de-select a radio button option in HTML, for some reasons why you might like to read this: https://ux.stackexchange.com/questions/13511/why-is-it-impossible-to-deselect-html-radio-inputs