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()">;

onSubmit

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="http://www.w3schools.com" onmouseover="alert('An onMouseOver event');return false">
<img src="w3schools.gif" width="100" height="30">
</a>