Textarea.onBlur

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

onBlur="command"

Description

The onBlur event handler of an instance of a Textarea object is fired when the focus is moved away from that particular text area. Care should be taken when using this event handler, because it is possible to get into an infinite loop when using onFocus event handler or focus() method.

Example

Listing 7.513 contains three text areas, one of which has the onBlur event handler used within its tag. The third text box is used for a counter for the number of times the onBlur event handler is used.

In the script, the event calls a function that reassigns the first text area focus. The result of this is that when a user tries to click or tab away ...

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.