Reputation: 21564
Is there a jquery method/whatever to toggle all checkboxes EXCEPT disabled ones? i have this code right now:
$('.select-all-categories').toggle(function() {
$('#test-categories input[type="checkbox"]').attr("checked", false);
return false;
}, function() {
$('#test-categories input[type="checkbox"]').attr("checked", true);
return false;
});
and it works fine(selects/deselects all checkboxes). BUt some of the checkboxes are disabled and I would like it to NOT be affected by the toggle. Is there a way to do this WITHOUT doing a for each and looping through all and checking if they are disabled or not?
Upvotes: 1
Views: 347