JSFiddle - React, Tailwind, and code Playground

by infatti

HTML

<div class="show-on-check">
    <label>
        <input type="checkbox" value="checkbox1"> Checkbox 1
    </label>
    <label>
        <input type="checkbox" value="checkbox2"> Checkbox 2
    </label>
</div>

<div class="checkbox1">Content for checkbox 1</div>
<div class="checkbox2">Content for checkbox 2</div>

JavaScript

$('.show-on-check input:checkbox').click(function () {

    $('.show-on-check input:checkbox').each(function(){

        if ($(this).is(':checked')) {
            $('.' + this.value).show();
        } else {
            $('.' + this.value).hide();
        }
        
    });

});