I was trying to find the meaning of this
keyword inside event handler function in the DOM level 3 event spec.
As per my experiment this
refers to the event.currentTarget
object.
Is this behavior mentioned somewhere in the standard?
As per "JavaScript The Definitive Guide" book this
refers to the event target
which seems to wrong. event.currentTarget
seems more logical as event handlers are invoked as the method of the HTML element object.
Can someone please clarify?
In case of bubbling I see "this" changes and means the event.currentTarget.