icheck
icheck copied to clipboard
Check if all checkbox are checked by class
I want to check if all checkbox if checked, but not working :(
if ($('.chkCityState:checked').length == $('.chkCityState').length) {
console.log('ALL ARE CHECKED');
}else{
console.log('NOT ALL CHECKED');
}
My second if statement was:
if ($('.chkCityState input[type="checkbox"]').not(':checked').length == 0)
How i can check this?
if ($('.chkCityState').filter(':checked').length == $('.chkCityState').length) { console.log('ALL ARE CHECKED'); }else{ console.log('NOT ALL CHECKED'); }
try this , its work for me