Common Event Handlers

Knowing which events can be associated with which objects is important.

It is much easier these days because the various browser are more consistent.

<img src='rose.gif' onclick='...some javascript..' />

Here is a list of some of the most common event handlers and the tags they apply to.

Event Associated Objects Comments
onabortimages occurs if user decides to stop downloading image
onblurwindows, all form elements, framesoccurs when user clicks away from a form object
onclickbuttons, radio buttons, checkboxes, submit buttons, reset buttons, links, images very useful
onchangetext fields, textareas, select listsactivates when a drop box element etc is clicked
onfocuswindows, frames, all form elementsopposite to onblur()
onloadwindow, body, images Use this to invoke JavaScript after the page or an image has finished loading.
<body onload="doit();"> very useful
onmouseoverareas, linksVery commonly used.
onmouseoutareas,linksVery commonly used.
onreset forms Used when a reset button is clicked
onselect text fields, textareassimilar to onfocus, not used much
onsubmit form can be used to check contents of a form
onunload bodyoften used to force a user to a related site - can be very irritating

Here is a more Comprehensive List from w3schools.