I have a collection of checkboxes
<
I think there would be a good feature in jquery an are
function:
jQuery.fn.are = function(selector) {
return !!selector && this.filter(selector).length == this.length;
};
Usage:
if($('input.paid[type=checkbox]').are(':checked'))
Example:
http://jsfiddle.net/9s2vA/
I have found this function at http://api.jquery.com/is/ written by Tgr , when I was checking if this exists.
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).