25.160. HTMLElement.onkeypress: event handler invoked when the user presses a keyDOM Level 025.160.1. SynopsisFunction onkeypress 25.160.2. DescriptionThe 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 AlsoHTMLElement.onkeydown; Chapter 17 |