Textarea.onChange

JavaScript1.0+, JScript1.0+ Nav2+, IE3+, Opera3+ Syntax

onChange="command"

Description

The onChange event handler of an instance of a Textarea object is fired when the text in the area is modified. 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 focus is placed on or away from the text area.

Example

Listing 7.514 has a single text area. If the user changes the text and then shifts the focus away from the text area by clicking elsewhere, the default text is placed back in the text area.

Listing 7.514 Using the onChange Event Handler to Change the Text Back to the Default
 <html> <head> <script language="JavaScript"> ...

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.