Here is a simple built-in version to demonstrate the general idea. You might want to pull it into a separate function in the real world.
If you want chk2 to automatically stay in sync with any changes to chk1, but don't do anything when you click chk2, go ahead.
<input id="chk1" type="checkbox" onclick="document.getElementById('chk2').checked = this.checked;">
<input id="chk2" type="checkbox">
This version only changes chk2 if chk1 is checked, but does nothing if ck1 is not checked.
<input id="chk1" type="checkbox" onclick="if (this.checked) document.getElementById('chk2').checked = true;">
<input id="chk2" type="checkbox">