Remove attribute “checked” of checkbox

后端 未结 9 1166
野的像风
野的像风 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.

提交回复
热议问题