Internet Explorer and JavaScript event currentTarget

后端 未结 13 2182
执笔经年
执笔经年 2020-11-30 05:36

Is there a way to take the current target of an event with IE 7 or 8?

With other browser (firefox, opera, chrome etc.) we can use event.currentTarget or

相关标签:
13条回答
  • 2020-11-30 06:19

    I'm assuming that you're wanting to use the 'this' context because the same handler will be dealing with multliple posible objects. In that case, see the excellent AddEvent script from the quirksmode recoding contest. (http://www.quirksmode.org/blog/archives/2005/09/addevent_recodi.html). This code has allowed me to get the very last of my javascript out of html. More importantly, it seems to work on all of the browsers that I've tested. Simple and compact.

    0 讨论(0)
提交回复
热议问题