Select.onFocus

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

onFocus="command"

Description

The onFocus event handler of an instance of a Select object is fired when the focus is set on that particular select box. Care should be taken when using this event handler, because it is possible to get into an infinite loop when using onBlur event handler or blur() method.

Example

Listing 7.472 contains a multiple select box and a text box. The select box has an onFocus event handler within its tag that is fired every time you select an option in the box. In the script, the onFocus event handler within the <select> tag calls a function that assigns the text box focus. Each time a user clicks or tabs to the select box, the counter is ...

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.