How to clear radio button in Javascript?

后端 未结 10 596
予麋鹿
予麋鹿 2020-12-02 19:57

I have a radio button named \"Choose\" with the options yes and no. If I select any one of the options and click the button labeled \"clear\", I need to clear the selected o

10条回答
  •  执念已碎
    2020-12-02 20:34

    If you have a radio button with same id, then you can clear the selection

    Radio Button definition :

     CASH
     CHEQUE
     DD
    

    Clearing all values of radio button:

    document.formName.paymentType[0].checked = false;
    document.formName.paymentType[1].checked = false;
    document.formName.paymentType[2].checked = false;
    ...
    

提交回复
热议问题