How to ignore click event when clicked on children

前端 未结 5 1217
北海茫月
北海茫月 2020-12-05 17:39

So I have the following scenario:

Sample text. Anchor link
5条回答
  •  感情败类
    2020-12-05 18:14

    This is what you need: http://api.jquery.com/event.target/ .

    Just compare to check if the element was triggered by the element you want or one of its children.

提交回复
热议问题