[Chapter 21] Reference: Text.onchange()
Author: David Flanagan
Date: Fri Aug 29 11:20:29 1997

#

| Chapter 21 JavaScript Reference |

# Text.onchange() Handler

## Name

Text.onchange() Handler---invoked when input value changes

## Availability

Navigator 2.0, Internet Explorer 3.0

## Synopsis

    <INPUT TYPE=text
           onchange="handler-statements" ...>  a definition of the handler
    text.onchange a reference to the handler
    text.onchange();  an explicit invocation of the handler

## Description

The `Text.onchange()` event handler is defined by the `onChange` attribute of the `<INPUT>` HTML tag that defines the Text object. The value of this attribute may be any number of JavaScript statements, separated by semicolons; these statements will be executed whenever the user changes the value in the input field and then "commits" those changes by moving keyboard focus elsewhere (i.e., by clicking the mouse elsewhere or by typing the Tab or Return keys). This handler is intended to process a complete change to the input value, and therefore is not invoked on a keystroke-by-keystroke basis. Also, note that the `onchange()` event hander is not invoked when the `value` property of a Text object is set by JavaScript.

## See Also

"Text", "Text.blur()", "Text.focus()", "Text.onblur()"

Text.onblur() |  | Text.onfocus()