icheck icon indicating copy to clipboard operation
icheck copied to clipboard

Check if all checkbox are checked by class

Open ooocrniooo opened this issue 8 years ago • 1 comments

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?

ooocrniooo avatar Apr 08 '16 10:04 ooocrniooo

if ($('.chkCityState').filter(':checked').length == $('.chkCityState').length) { console.log('ALL ARE CHECKED'); }else{ console.log('NOT ALL CHECKED'); }

try this , its work for me

shanpratheep avatar Oct 15 '16 06:10 shanpratheep