Source: jQuery see if any or no checkboxes are selected
1 2 3 4 5 6 7 8 9 |
// jQuery see if any or no checkboxes are selected // https://stackoverflow.com/a/4087006 $.fn.areAnyCheckboxesChecked = function(HTMLScope){ // Retourne true/false return !!$('input[type=checkbox]:checked', HTMLScope).length; // Retourne le nombre de checkboxes qui sont checked (0 si aucune) return $('input[type=checkbox]:checked', HTMLScope).length; } |