Prevent execution of parent event handler

后端 未结 2 1926
暗喜
暗喜 2020-11-22 07:20

I have a tree of divs:

2条回答
  •  没有蜡笔的小新
    2020-11-22 07:37

    use

    event.stopPropagation()

    Stops the bubbling of an event to parent elements, preventing any parent handlers from being notified of the event.

    when click on b and c

提交回复
热议问题