Event.FOCUS

JavaScript 1.0+, JScript 1.0+ Nav2+, IE 3+, Opera3+ Syntax

Event.FOCUS

Description

The FOCUS property of the Event object is used by windows, frames, and form elements to indicate when focus is applied to an object.

Example

Listing 7.224 shows an example of how the FOCUS property is used to determine when focus is set on a certain object. As you click each object, a message is displayed in the message box indicating which object has focus. The onFocus event handler handles all Event.FOCUS events by default.

Listing 7.224 Accessing the FOCUS Property
 <html> <head> <title>Example of Event.FOCUS</title> </head> <body> <script language="JavaScript"> <!--Hide function showMsg1(){ document.form1.msg.value += "Focus set on Text ...

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.