Remove attribute “checked” of checkbox

后端 未结 9 1168
野的像风
野的像风 2020-12-11 00:11

I need remove the attribute \"checked\" of one checkbox when errors occur.

The .removeAttr function not work. Any idea? :/

HTML

相关标签:
9条回答
  • 2020-12-11 00:46

    I use prop attribute for unchecked the checkbox when errors occur. You don't need to use remove property for unchecked your checkbox.

    $('input#IDName').prop('checked', false);
    

    It is working fine for me. Hope it will work for you also.

    0 讨论(0)
  • 2020-12-11 00:52

    Try...

    $("#captureAudio").prop('checked', false); 
    
    0 讨论(0)
  • 2020-12-11 00:53

    Try:

    $("#captureAudio")[0].checked = false;
    
    0 讨论(0)
提交回复
热议问题