</script><styletype="text/css">
.focused #focused, .blurred #blurred { display: inline }
.focused #blurred, .blurred #focused { display: none }
.focused {
background: white;
color: black;
}
.blurred {
background: black;
color: white;
}
</style></head><bodyclass="focused"><h1>window.onfocus() and window.onblur() demo</h1><p>Switch to a different program to blur this page.</p><p>You can also just click into the location bar (except in Safari).</p><p>Click this page again to focus it.</p><p>When blurred, this page will have a black background with white text.</p><p>The window is currently <spanid="focused">FOCUSED</span><spanid="blurred">BLURRED</span>.
<p><ahref="http://www.thefutureoftheweb.com/blog/detect-browser-window-focus">Click here for a discussion of this demo.</a></p><pid="log"></p><input></body></html>