Latest web development tutorials

Window blur () method

Window Object Reference Window object

Definition and Usage

blur () method to the keyboard focus away from the top-level window.

grammar

window.blur()


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

In addition to the Opera browser, and all major browsers support the blur () method.


Examples

Examples

Ensure that the new window does not get the focus (new window sent to the background):

<html>
<head>
<script>
function openWin()
{
myWindow=window.open('','','width=200,height=100');
myWindow.document.write("<p>The new window.</p>");
myWindow.blur();
}
</script>
</head>
<body>

<input type="button" value="Open window" onclick="openWin()">

</body>
</html>

try it"


Examples

More examples

Ensure that the new window receives focus


Window Object Reference Window object