当前位置: 动力学知识库 > 问答 > 编程问答 >

jquery - Deselect Checkbox

问题描述:

I want to deselect the checkboxes that are in disabled state using JQuery

I used live type with 'change' event in Jquery. The following code deselects all checkboxes. But I need only for disabled checkboxes.

$('.checkboxGroups').removeAttr('checked').trigger('change');

Thanks.

网友答案:

You can use something like

$(".checkboxGroups:disabled")

See more about :disabled Selector

网友答案:

try this

   $(".checkboxGroups:disabled").prop('checked', false);
网友答案:

Use the CSS :disabled pseudo-selector:

$('.checkboxGroups:disabled').removeAttr('checked').trigger('change');

...though given the plurality of the classname -- is '.checkboxGroups' the container?

If so, then:

$('.checkboxGroups input:disabled').removeAttr('checked').trigger('change');
网友答案:

First you have to find the disable checkboxes using the below statement then perform your opearation.

$('.checkboxGroups').attr('disabled', true)
分享给朋友:
您可能感兴趣的文章:
随机阅读: