Reputation:
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.
Upvotes: 0
Views: 258
Reputation: 6123
First you have to find the disable checkboxes using the below statement then perform your opearation.
$('.checkboxGroups').attr('disabled', true)
Upvotes: 0
Reputation: 15394
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');
Upvotes: 0
Reputation: 14460
You can use something like
$(".checkboxGroups:disabled")
See more about :disabled Selector
Upvotes: 0