JavaScript Editor JavaScript Validator     JavaScript Editor 



Team LiB
Previous Section Next Section

Events

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.

Mouse Events

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.

Keyboard Events

Event

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.

HTML Control Events

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.

Window Events

Event

Introduced

Description

onload

JavaScript 1.0

Raised when the window has completed loading.

onresize

JavaScript 1.2

Raised when the user resizes the window.

onunload

JavaScript 1.0

Executes JavaScript code when the user exits a document.

Other Events

Event

Introduced

Description

onabort

JavaScript 1.1

Raised when the user aborts loading an image.

onerror

JavaScript 1.1

Raised when an error occurs loading the page.


Team LiB
Previous Section Next Section


JavaScript Editor JavaScript Validator     JavaScript Editor


©