Understanding the Event Parameter
Step 1 of 5
When an event happens, JavaScript creates an event object that contains all the information about that event. This object is automatically passed to your event handler function!
Event handlers receive the event object as their first parameter. You can call it anything, but "event", "e", or "evt" are common:
function(event)function(e)function(evt)Event objects give you powerful information: