I want to select all checkbox
elements expect disabled ones,
this is my html
Use not() to exclude things with a disabled attribute.
$('#chkSelectAll').click(function () {
var checked_status = this.checked;
$('div#item input[type=checkbox]').not("[disabled]").each(function () {
this.checked = checked_status;
});
});
more concise
$('#chkSelectAll').click(function () {
var checked_status = this.checked;
$('div#item input[type=checkbox]').not(":disabled").prop("checked", checked_status);
});