<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<input type="checkbox" name="select-all" id="select-all" /> Tout cocher<br>
<input type="checkbox" id="ch1" /> A<br>
<input type="checkbox" id="ch2" /> B<br>
<input type="checkbox" id="ch3" /> C<br>

$('#select-all').click(function(event) {   
    if(this.checked) {
        $(':checkbox').each(function() {
            this.checked = true;
        });
    } else {
        $(':checkbox').each(function() {
            this.checked = false;
        });
    }
}); 

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.