Internet Explorer and JavaScript event currentTarget

后端 未结 13 2221
执笔经年
执笔经年 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 05:58

    I had similar problem. I solved it using keyword this as stated in an article on brainjar.com

    To get the equivalent of the currentTarget property in IE, use the this keyword as an argument when setting the event handler in a tag.

    ...

    function myHandler(event, link) { ... }

    On the same page you can find the following table :

    enter image description here

提交回复
热议问题