JSFiddle - React, Tailwind, and code Playground
by Matt Ball
HTML
<script src="https://rawgithub.com/mjball/jQuery-CheckAll/master/jquery.checkall.js"></script>
<form action="#" id="myform">
<fieldset>
<div><label><input type="checkbox" id="checkall"/> Check all</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
<div><label><input type="checkbox"/> Checkbox</label></div>
...
JavaScript
$('#checkall').checkAll('#myform input:checkbox:not(#checkall)');
// there are 500 slaves in this example
// don't believe me? uncomment the following line:
//alert($('#myform input:checkbox:not(#checkall)').length);