JSFiddle - React, Tailwind, and code Playground
by ian Woodward
HTML
<div class="row-fluid" id="set_alarm">
<label class="checkbox inline">
<input type="checkbox" id="select_all"><b>Select All</b>
</label><br>
<label class="checkbox inline days">
<input type="checkbox" id="Mon"><b>Mon</b>
</label>
<label class="checkbox inline days">
<input type="checkbox" id="Tue"><b>Tue</b>
</label>
</div>
JavaScript
$('#select_all').change(function() {
if($(this).is(':checked')) {
$("input[type='checkbox']").attr('checked', 'checked');
} else {
$("input[type='checkbox']").removeAttr('checked');
}
});
$("input[type='checkbox']").not('#select_all').change( function() {
$('#select_all').removeAttr('checked');
});