You're misusing <label>
element. There's no point doing magic tricks to make clicking it affect the corresponding <input>
when you can do it directly. Quoting the docs (MDN):
The HTML <label>
Element represents a caption for an item in a user
interface. It can be associated with a control either by placing the
control element inside the label element, or by using the for
attribute. Such a control is called the labeled control of the label
element.
So both...
<label><input type="checkbox" />Whatever</label>
... and, more complex, but more flexible:
<input type="checkbox" name="some_checkbox" id="some_checkbox" />
<label for="some_checkbox">Whatever it is</label>
... will work.
Demo.