Section 25.160. HTMLElement.onkeypress: event handler invoked when the user presses a key


25.160. HTMLElement.onkeypress: event handler invoked when the user presses a key

DOM Level 0

25.160.1. Synopsis

 Function onkeypress 

25.160.2. Description

The onkeypress property of an HTMLElement object specifies an event-handler function that is invoked when the user presses and releases a key while the element has the keyboard focus. A keypress event is generated after a keydown event and before the corresponding keyup event. The keypress and keydown events are similar, although a keypress event is often more useful for alphanumeric keys, and a keydown handler can be more useful for function keys.

Determining which key was pressed and what modifier keys were in effect at the time is somewhat complex and browser-dependent. See Chapter 17 for details.

25.160.3. See Also

HTMLElement.onkeydown; Chapter 17




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net