Textarea.onKeyPress

JavaScript1.2+, JScript3.0+ Nav4+, IE4+ Syntax

onKeyPress="command"

Description

The onKeyPress event handler of an instance of a Textarea object is fired when a key is pressed within the text area. Care should be taken when using this event handler, because it is possible to get into an infinite loop when using other events or methods that are fired when the focus is placed on or away from the text area or other key-related events are used. This event is called after an onKeyDown event handler.

Example

Listing 7.517 has a single text area. If the user presses a key while the focus is on the text area, an alert box is displayed as soon as the key is pressed showing the type of event that was fired. The first event handler ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.