0

I was struggling a bit to handle the mouseout event on a div with a bunch of nested elements. I found this answer, which helped me, but leaves me with a further question.

The proposed answser uses this in the event handler and as far as I could test it effectively points to the element to which the handler was originally attached, and not its descendants.

My question is : is that documented somewhere ? I can't seem to find it on MDN.

Community
  • 1
  • 1
Éric Viala
  • 596
  • 2
  • 12

1 Answers1

2

Is this document?

About the handle function :

As a DOM event handler
When a function is used as an event handler, its this is set to the element the event fired from (some browsers do not follow this convention for listeners added dynamically with methods other than addEventListener).

Cheng.Lee
  • 186
  • 2
  • 11