Skip to content

Instantly share code, notes, and snippets.

@faraz046
Created November 2, 2012 14:14
Show Gist options
  • Save faraz046/4001586 to your computer and use it in GitHub Desktop.
Save faraz046/4001586 to your computer and use it in GitHub Desktop.
Jquery checkboxes status
//give all the check boxes a class and pass the class name as a string to the function and it will return if any of the checkbox was checked.
function checkboxesstatus(cls) {
var el = $('input.'+cls);
var boxstatus = 0;
el.each(function(){
if($(this).is(':checked')) {
boxstatus++;
}
});
return boxstatus;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment