Javascript events
In Javascript, an event is an action performed on a webpage by the user such as clicking a button or entering text into a textbox. Event handlers are used to detect these events and act upon them accordingly.
Event handlers are the way Javascript deals with events. Javascript contains a variety of event handlers for various purposes.
The following is a list of event handlers used in Javascript and in which situation they occur.
Legend:
IE = Internet Explorer
FF = Firefox
N = Netscape
NOTE: The numbers next to the browser name indicate the earliest version of a browser a function is available in.
onabort
Occurs when the loading of an image is interrupted.
FF - 1
N - 1
IE - 4
onblur
Occurs when an element has lost focus.
FF - 1
N - 2
IE - 3
onchange
Occurs when the content of an element has changed.
FF - 1
N - 2
IE - 3
onclick
Occurs when an element is clicked.
FF - 1
N - 2
IE - 3
ondblclick
Occurs when an element is double clicked.
FF - 1
N - 4
IE - 4
onerror
Occurs when there is an error during the loading of a document or image.
FF - 1
N - 3
IE - 4
onfocus
Occurs when an element has gained focus.
FF - 1
N - 2
IE - 3
onkeydown
Occurs when a key on the keyboard is pressed.
FF - 1
N - 4
IE - 3
onkeypress
Occurs when a key on the keyboard is pressed or held down.
FF - 1
N - 4
IE - 3
onkeyup
Occurs when a key on the keyboard is released.
FF - 1
N - 4
IE - 3
onload
Occurs when a page or image has finished loading.
FF - 1
N - 2
IE - 3
onmousedown
Occurs when a mouse button is pressed.
FF - 1
N - 4
IE - 4
onmousemove
Occurs when the mouse is moved.
FF - 1
N - 6
IE - 3
onmouseout
Occurs when the mouse is moved off of an element.
FF - 1
N - 4
IE - 4
onmouseover
Occurs when the mouse is moved onto an element.
FF - 1
N - 2
IE - 3
onmouseup
Occurs when a mouse button is released.
FF - 1
N - 4
IE - 4
onreset
Occurs when a form is reset.
FF - 1
N - 3
IE - 4
onresize
Occurs when a window or a frame is resized.
FF - 1
N - 4
IE - 4
onselect
Occurs when text is selected.
FF - 1
N - 2
IE - 3
onsubmit
Occurs when a form is submitted.
FF - 1
N - 2
IE - 3
onunload
Occurs when a page is exited.
FF - 1
N - 2
IE - 3




