I have this label:
Interactive elements inside interactive elements cause functional problems like this: it is undefined what happens when you click an a
element inside a label
element or vice versa. To avoid this, take the a
element out of the label
element, e.g.
<label><input type="checkbox">I agree</label> to the <a href="terms">terms</a>
and would like to continue
or
<input type="checkbox" id="agree"><label for="agree">I agree</label> to the
<a href="terms">terms</a> and would like to continue
Stop propagation of the click event on the link. This prevents the click event from bubbling up to the label.
https://developer.mozilla.org/en-US/docs/Web/API/event.stopPropagation