JavaScript JavaScript and the DOM Responding to User Interaction The Event Object

Jeffrey Holcomb
Jeffrey Holcomb
Full Stack JavaScript Techdegree Student 8,875 Points

I do not understand how the 'event' argument we pass into the event handler function ends up being the event object.

Perhaps there is something about the nature of the addEventListener() method that I do not understand, but how/why does the argument named 'event' actually target the event object? I know it is named 'event' strictly for naming conventions, and that if we named it something else, it would have the same behavior. Does the callback function take an event object by default as an argument?

1 Answer