I\'m trying to write a piece of jQuery code where, if all checkboxes are \"unchecked\", then all li tags have the class \"disabled.\"
But, if one checkbox (any checkbox)
$(':checkbox') .click( function() { $('li').toggleClass('disabled', $(':checkbox :checked').length <= 0)); } );
EDIT: Thanks Ken for pointing out toggleClass method.