How to prevent a link inside a label from triggering a checkbox?

前端 未结 8 1507
难免孤独
难免孤独 2021-01-03 18:41

I have this label:

8条回答
  •  悲&欢浪女
    2021-01-03 19:29

    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

提交回复
热议问题