Created
November 2, 2012 14:14
-
-
Save faraz046/4001586 to your computer and use it in GitHub Desktop.
Jquery checkboxes status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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