JavaScript window.blur() Method

You are Here:

JavaScript window.blur() Method

The window.blur() method shifts focus from the current window.

Example

HTML Online Editor
<!DOCTYPE html> <html> <body> <button onclick="myOpen()">Open Window</button> <button onclick="myFocus()">focus Window</button> <button onclick="myBlur()">blur Window</button> <script> var myWindow; function myOpen() { myWindow = window.open("", "myWindow", "width=400, height=200"); myWindow.document.write("<p>A new window!</p>"); } function myFocus(){ myWindow.focus(); } function myBlur(){ myWindow.blur(); } </script> </body> </html>

Syntax

window.blur()

Reminder

Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in JavaScript.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author