The following tables describe the event handlers available in client-side JavaScript. Note that the elements supporting these event handlers differ considerably in Netscape Navigator and Internet Explorer.
To handle an event, the event handler and the function to handle it must be specified in the HTML element for which the event applies.
Event |
Introduced |
Description |
---|---|---|
onclick |
JavaScript 1.0 |
Raised when the user clicks on an HTML control. |
ondblclick |
JavaScript 1.2 |
Raised when the user double-clicks on an HTML control. |
onmousedown |
JavaScript 1.2 |
Raised when the user presses a mouse button. |
onmousemove |
JavaScript 1.2 |
Raised when the user moves the mouse pointer. |
onmouseout |
JavaScript 1.1 |
Raised when the user moves the mouse pointer out from within an HTML control. |
onmouseover |
JavaScript 1.0 |
Raised when the user moves the mouse pointer over an HTML control. |
onmouseup |
JavaScript 1.2 |
Raised when the user releases the mouse button. |
Introduced |
Description |
|
---|---|---|
onkeydown |
JavaScript 1.2 |
Raised when the user presses a key on the keyboard. |
onkeypress |
JavaScript 1.2 |
Raised when the user presses a key on the keyboard. This event will be raised continually until the user releases the key. |
onkeyup |
JavaScript 1.2 |
Raised when the user releases a key that had been pressed. |
Event |
Introduced |
Description |
---|---|---|
onblur |
JavaScript 1.0 |
Raised when an HTML control loses focus. |
onchange |
JavaScript 1.0 |
Raised when an HTML control loses focus and its value has changed. |
onfocus |
JavaScript 1.0 |
Raised when focus is set to the HTML control. |
onreset |
JavaScript 1.1 |
Raised when the user resets a form. |
onselect |
JavaScript 1.0 |
Raised when the user selects text in an HTML control. |
onsubmit |
JavaScript 1.0 |
Raised when the user submits a form. |