Name
Window.onblur: event handler invoked when the window loses keyboard focus — JavaScript 1.1:
Synopsis
Function onblur
Description
The onblur property of a
Window specifies an event-handler function that is invoked when the
window loses keyboard focus.
The initial value of this property is a function that contains
the semicolon-separated JavaScript statements specified by the
onblur attribute of the <body> or <frameset> tags.
Usage
If your web page has animation or other dynamic effects, you
can use the onblur event handler
to stop the animation when the window doesn’t have the input focus.
In theory, if the window doesn’t have the focus, the user probably
can’t see it or isn’t paying attention to it.
See Also
Window.blur( ), Window.focus( ), Window.onfocus; Chapter 17
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access