Share via


DHTML Events (Windows Embedded CE 6.0)

1/6/2010

Clicking a button, moving the mouse pointer over part of the Web page, selecting some text on the page: these actions all raise events, and a DHTML author can write code to run in response to the event. This particular segment of code is generally known as an event handler. The Internet Explorer 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.

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

Ee492068.collapse(en-US,WinEmbedded.60).gifMouse events

Mouse event generated User action

onmouseover

Moves the mouse pointer over (enters) an element

onmouseout

Moves the mouse pointer away from (exits) an element

onmousedown

Presses any of the mouse buttons

onmouseup

Releases any of the mouse buttons

onmousemove

Moves the mouse pointer inside an element

onclick

Clicks the left mouse button on an element

ondblclick

Double-clicks the left mouse button on an element

Ee492068.collapse(en-US,WinEmbedded.60).gifKeyboard events

Keyboard event generated User action

onkeypress

Presses and releases a key (full down-and-up cycle). However, if a key is held down, multiple onkeypress events are fired.

onkeydown

Presses a key. Only a single event is fired, even if the key is held down

onkeyup

Releases a key

For more information about event handling in Internet Explorer, including event bubbling and handling rollover effects, see this Microsoft Web site.

See Also

Other Resources

Internet Explorer MSHTML/DHTML API Application Development