У меня есть наборы флажков и повернутый h4 рядом с каждым набором.
Я пытаюсь сделать так, чтобы, когда я нажимаю чекбоксы, связанные с аллой h4
-все проверено - если они не все уже проверены, если это так, снимите все галочки.

jПросьба к ближайшему, за который я зашел:
jQuery(".sidewaysHeader h4").click(function() {
var now = $(this).attr('id');
$('input:checkbox[name="'+ now +'"]').attr('checked', true );
});
HTML:
<div class="sidewaysHeader"><h4 id="halsa">Hälsa</h4></div>
<input type="checkbox" value="idrott" id="idrott" name="halsa" /><label for="idrott">Idrott</label><br />
<input type="checkbox" value="dans" id="dans" name="halsa" /><label for="dans">Dans</label><br />
<input type="checkbox" value="hemkunskap" id="hemkunskap" name="halsa" /><label for="hemkunskap">Hemkunskap</label><br />
<input type="checkbox" value="mat-och-boende" id="mat-och-boende" name="halsa" /><label for="mat-och-boende">Mat & Boende</label>