Reputation: 6902
In modern browsers, the addEventListener property belongs to the EventTarget interface.
According to MDNs compatibility chart - it's being supported starting with IE9, however, I'm not able to access it from either IE9 or 10.
What interface does addEventListener belongs to in IE?
Upvotes: 0
Views: 218
Reputation: 765
I've made some prototype chain sniffing on Edge/IE console:
IE11: the window object, You have the Window constructor, and Window.prototype.hasOwnProperty('addEventListener') is true.
About html elements:
all of them gets it from constructor called Node
Node.prototype.hasOwnProperty('addEventListener') is true. (document.body instanceof Node) === tue
I believe it will be the same for IE9/10
On Edge its different, you do have the EventTarget object that in the prototype chain of html elements & window objects
I wonder if its spec incompatibility from IE side or its considered implementation details
Upvotes: 1