It is important to distinguish the terminology used regarding events, especially since Netscape and Microsoft use the same words slightly differently. Just to be clear, I shall list terminology from a Netscape perspective and give the Microsoft equivalence.

Event

Aka Event Type. This is the event that occurs. EG: click. This is a user action or conditions that the browser recognizes as an event.

What Netscape refers to as an "event", Microsoft also refers to as an "event". However, Microsoft also uses the term "event" to refer to what Netscape refers to as an "event handler". EG: onclick.

Event Handler

This is usually the attribute of an element that identifies what event occurred and has a value that evaluates to script that handles the event, i.e. the event handler code.

This is typical syntax for registering an event handler. The "onevent" is the event handler.

<tag onevent="event handler code" ...>

Here is an example. The "onclick" is the event handler.

<a onclick="RunMe()" ....>

What Netscape refers to as an "event handler", Microsoft refers to as an "event".

Event Handler Code

This is the script that runs when an event fires.

  • Primary event handler code. Code directly linked with the element that fired the event.
  • Secondary event handler code. Code that captures or intercepts the event and decides whether or not the primary event handling code ever responds to the event.

Here are some typical examples of Event Handler Code:

alert('hi!')
<script language="JavaScript">
function RunMe(){
    alert('hi!')
}

What Netscape refers to as "Event Handler Code", Microsoft refers to as "Event Handler".

Event Object

This is the object is a direct child of the window object. It has information about the event that just occurred. Its syntax is:

event.property
window.event.property


GeorgeHernandez.comSome rights reserved