Finding all checkboxes are checked in jQuery
jquery
Solution
Like this:
if (!$('input.paid[type=checkbox]:not(:checked)').length)
do('stuff');
This will check if there are any that are unchecked, and do stuff if there aren't (i.e. they are all checked).
Problem
I have a collection of checkboxes ``` <input id="1" class="paid" type="checkbox" /> <input id="2" class="paid" type="checkbox" /> <input id="3" class="paid" type="checkbox" /> <input id="4" class="paid" type="checkbox" /> ``` I would like to write some jQuery to check if all checkboxes are checked then perform an action but how?