Javascript events

For a complete reference of the events recognized by JavaScript, see complete Event reference.

onLoad and onUnload

The onload and onUnload events are triggered when the user enters or leaves the page.

onFocus, onBlur and onChange

The onFocus, onBlur and onChange events are often used in combination with validation of form fields.

<input type="text" size="30" id="email" onChange="checkEmail()">;


The onSubmit event is used to validate ALL form fields before submitting it.

<form method="post" action="xxx.htm" onSubmit="return checkForm()">

onMouseOver and onMouseOut

<a href="" onmouseover="alert('An onMouseOver event');return false">
<img src="w3schools.gif" width="100" height="30">