English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Window focus() Method

JavaScript Window Object

focus()The method requests to bring the window to the foreground (close to the screen).

Usageblur()The method removes the focus from the current window.

Syntax:

window.focus()
var popupWindow = window.open("https://www.oldtoolbag.com");
popupWindow.focus();
Test See‹/›

Browser Compatibility

All browsers fully support the focus() method:

Method
focus()YesYesYesYesYes

Technical Details

Return Value:None

Related References

Window (Window) Reference:blur() method

JavaScript Window Object