An event is an unexpected external occurrence. Most JavaScript-applications perform actions as a response to events. An event is a signal from the browser that something has happened. Javascript provides events and event handlers to handle user interactions. These events and event handlers are as follows:
Uses the event handler onAbort to handle aborting of an image loaded by the user.
Uses onBlur handler to handle the event when an element, window or fram looses input focus.
Uses onChange handler to handle change in the value of a text field or area.
Uses onClick handler when an object in a form is clicked.
Uses a ondblClick handler to handle double clicking of a form object or link by the user.
onError handler is used when there is an error in loading a document or an image.
Uses an onFocus handler to handle events like receiving of events by a window or frame.
Uses an onLoad handle to handle the event when the browser finishes loading a browser window.
Uses an onMouseOver handler when the curser move over an area.
Uses an onMouseOut handler when the curser out from an area.
Uses an onMouseOut handler when the curser out from an area.
Uses an onReset handler to handle the event when a form is reset.
Uses onSubmit handler to handle the event when the user submit the form.
Uses onUnload handler to handle the event when the user exits a document.
Uses onKeyDown to handle the event of user depressing a key.
Uses onKeyPress handler to process key presses.
Uses onKeyUp handler to process events like user releasing a key.
Uses onMouseDown handler when the user presses mouse button.
Uses onMouseUp handler when the user releases a mouse button.
The standard HTML 4 events are listed here for your reference. Here script indicates a Javascript function to be executed agains that event.
Event | Value | Description |
---|---|---|
onchange | script | Script runs when the element changes |
onsubmit | script | Script runs when the form is submitted |
onreset | script | Script runs when the form is reset |
onselect | script | Script runs when the element is selected |
onblur | script | Script runs when the element loses focus |
onfocus | script | Script runs when the element gets focus |
onkeydown | script | Script runs when key is pressed |
onkeypress | script | Script runs when key is pressed and released |
onkeyup | script | Script runs when key is released |
onclick | script | Script runs when a mouse click |
ondblclick | script | Script runs when a mouse double-click |
onmousedown | script | Script runs when mouse button is pressed |
onmousemove | script | Script runs when mouse pointer moves |
onmouseout | script | Script runs when mouse pointer moves out of an element |
onmouseover | script | Script runs when mouse pointer moves over an element |
onmouseup | script | Script runs when mouse button is released |