Difference between e.target and e.currentTarget

后端 未结 10 1014
谎友^
谎友^ 2020-11-22 06:29

I don\'t understand the difference, they both seem the same but I guess they are not.

Any examples of when to use one or the other would be appreciated.

10条回答
  •  自闭症患者
    2020-11-22 06:45

    e.target is what triggers the event dispatcher to trigger and e.currentTarget is what you assigned your listener to.

提交回复
热议问题