JSFiddle - React, Tailwind, and code Playground

HTML

<div id="c1">
    <input type="checkbox" name="checkbox1" id="1" checked />
    <input type="checkbox" name="checkbox2" id="2" checked />
    <input type="checkbox" name="checkbox3" id="3" checked />
</div>
<input type="checkbox" name="master" id="master" checked />

JavaScript

$('#c1').hide();

$('#master').change(function() {
        // Click the children of c1 when the master is clicked
    $('#c1').children().click();
    
        // Display the current values in an alert
    var result = $('#c1').children().map(function() {
        return $(this).attr('checked');
    }).get().join(',');
    
    alert(result);
});