Disable the onclick event of a parent element

后端 未结 5 1968
清酒与你
清酒与你 2021-01-07 05:13

Let\'s say I have an element with an onclick event, and another element inside it, how do I disable the onclick for the child element?

Example:

5条回答
  •  难免孤独
    2021-01-07 05:47

    You can have an onClick for the checkbox that sets the h3.onClick property to blank if the box is checked, and sets it to the correct function reference if it is not checked.

提交回复
热议问题