This segment of code includes HTML for a table along with JavaScript functionality. When a checkbox is clicked, another table will be displayed:
<form class="filter">
<input type="checkbox" id="checkboxID" class="unchecked"> EG
<input type="checkbox" id="checkbox1OG" class="unchecked"> 1.OG
<input type="checkbox" id="checkbox2OG" class="unchecked"> 2.OG
<input type="checkbox" id="checkbox3OG" class="unchecked"> 3.OG
</form>
<script>
$('input.unchecked').on('change', function() {
$('input.unchecked').not(this).prop('checked', false);
});
</script>
<script>
$("#checkboxID").change(function(){
$("#tableID tr.rowEG").toggle(!this.checked);
});
$("#checkbox1OG").change(function(){
$("#tableID tr.row1OG").toggle(!this.checked);
});
$("#checkbox2OG").change(function(){
$("#tableID tr.row2OG").toggle(!this.checked);
});
$("#checkbox3OG").change(function(){
$("#tableID tr.row3OG").toggle(!this.checked);
});
</script>
Unfortunately, when clicking on the checkboxes, the table disappears.