drgullin / icheck

Highly customizable checkboxes and radio buttons (jQuery & Zepto)
http://fronteed.com/iCheck
7.39k stars 1.63k forks source link

Check if all checkbox are checked by class #330

Open ooocrniooo opened 8 years ago

ooocrniooo commented 8 years ago

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?

shanpratheep commented 7 years ago

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

try this , its work for me