I want to select all checkbox
elements expect disabled ones,
this is my html
$('#chkSelectAll').click(function () {
var checked_status = this.checked;
// alert(checked_status);
$('div#item input[type=checkbox]').each(function () {
if(!$(this).is(':disabled'){
this.checked = checked_status;
}
});
})
I'd personally suggest:
$('#chkSelectAll').change(function(){
var self = this;
$('input:checkbox').filter(function(){
return !this.disabled
}).prop('checked',self.checked);
});
JS Fiddle demo.
References: