O'Reilly logo
  • Ahmed Elgendy thinks this is interesting:

How the event object works

When the click handler is called, it’s passed an event object—and in fact, for most of the events associated...


Cover of Head First JavaScript Programming


How does the event object work? A tip: here we do not have to code our "event handler/function" to go through some searching algorithm to find out which "target/element object" initiated the event but the parameter of the function which is the "event object" will be carrying information about the "target". And all you will need to do is to identify this "target" which is a property of the "event object".