DHTML Tutorials

Events in DHTML
Previous Home Next

Clicking a button, moving the mouse pointer over part of the Web page, selecting some text on the page — these actions all fire events, and a DHTML author can write code to run in response to the event. This particular piece of code is generally known as an event handler. The Event model makes it possible for every HTML element on the page to be the source for a full set of mouse and keyboard events.

Event handlers are triggers to the JavaScript functions or the CSS elements based on the specific events normally called through the user action over the DOM elements such as events like mouseover, click etc. or specified in the code such as events such as load like loading a window or frame etc.

The following table show a set of common events that every HTML element generates in Internet Explorer.

Event When it occurs
onabort User aborted page loading
onchange User changed the value of an object
onclick User clicked on an object
ondblclick User double clicked an object
onfocus User made an object active
onkeydown When a keyboard key is on its way down
onkeypress When a keyboard key is pressed
onkeyup When a keyboard key is released
onload Page finished loading
onmousedown User pressed a mouse-button
onmousemove Cursor moving on an object
onmouseover Cursor moved over an object
onmouseout Cursor moved off an object
onmouseup User released a pressed mouse-button
onselect User selected content on a page
onsubmit User submitted a form
Previous Home Next