Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
jQuery snippet to limit how many checkboxes can be checked
$( '.things' ).click( function() {
var bol = $( '.things:checked' ).length >= 8;
$( '.things' ).not( ':checked' ).attr( 'disabled', bol );
});
// from http://stackoverflow.com/questions/2966382/limit-checkbox-amount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.