DOM Event interface
Event handlers may be attached to various elements in the DOM. When an event occurs, an event object is dynamically created, and passed sequentially to the event listeners that are allowed to handle the event. The DOM Event interface is then accessible within the handler function, via the event object passed as the first (and the only) argument.
The following simple example shows how an event object is passed to the event handler function, and can be used from within one such function.
Note there is no “evt” parameter passed in the code below. The event object gets passed automatically to foo. All that is needed is to define a parameter in the event handler to receive the event object.
function foo(evt) {
// event handling functions like this one
// get an implicit reference to the event object they handle
// (in this case we chose to call it "evt").
alert(evt);
}
table_el.onclick = foo;
Example
<html>
<head>
<title>event object parameter example</title>
<script type="text/javascript">
function showCoords(evt){
alert(
"clientX value: " + evt.clientX + "\n" +
"clientY value: " + evt.clientY + "\n"
);
}
</script>
</head>
<body onmousedown="showCoords(event)">
<p>To display the mouse coordinates click anywhere on the page.</p>
</body>
</html>
source: https://developer.mozilla.org/En/DOM:event