'How is jQuery able to normalize currentTarget for IE?
In an event handler in a standard compliant browser, this
and e.currentTarget
(where e
is the parameter of the handler) refer to the element to which the handler is attached, which by the way isn't necessarily the same as e.target
.
Problem is, there is no e.currentTarget
in old versions of Internet Explorer.
In old IE, this
in an event handler is simply the global object and e
is undefined and window.event.srcELement
is just equivalent to e.target
and not to e.currentTarget
.
Question is, what kind of magic is jQuery pulling off to make e.currentTarget
work even in IE?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|