A jQuery plugin giving you superpowers over your checkboxes.
Get started in seconds.
npm install checkboxes.js
github.com/rmariuzzo/checkboxes.js/releases
Everything you need for checkbox management.
Uncheck all checkboxes within a context element.
$('#btn-uncheck-all').on('click', function(e) {
$('#table2').checkboxes('uncheck');
e.preventDefault();
});
<a href="#table2"
data-toggle="checkboxes"
data-action="uncheck">Uncheck all</a>
| #table2 |
|---|
Toggle the state of all checkboxes within a context element.
$('#btn-toggle').on('click', function(e) {
$('#table3').checkboxes('toggle');
e.preventDefault();
});
<a href="#table3"
data-toggle="checkboxes"
data-action="toggle">Toggle all</a>
| #table3 |
|---|
Check a range of checkboxes: check the first, then hold SHIFT and check another to select all in between.
$('#table4').checkboxes('range', true);
<div data-toggle="checkboxes"
data-range="true">
...
</div>
| #table4 |
|---|
Limit the maximum number of checkboxes that can be checked within a context.
$('#table5').checkboxes('max', 3);
<div data-toggle="checkboxes"
data-max="3">
...
</div>
| #table5 max 3 |
|---|