window.onFocus

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

onFocus="command"

Description

The onFocus event handler of a property of a Window object is fired when the focus is placed on that particular window instance. 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. Note that when this event handler is called within the <body> tag, it is overridden if a <frame> tag that also uses this event handler loaded the document.

Note

Some Navigator 3 browsers do not fully support this event handler when called in a <frameset> tag.

Example

Listing 7.558 has a frame set with two frames. The first frame, toc, has the onFocus event ...

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.