The Window.getAttention()
method attempts to get the user's attention. The mechanism for this happening depends on the specific operating system and window manager.
Syntax
window.getAttention();
Notes
On Windows, the taskbar button for the window flashes, if this hasn't been disabled by the user.
On Linux, the behaviour varies from window manager to window manager - some flash the taskbar button, others focus the window immediately. This may be configurable as well.
On Macintosh, the icon in the upper right corner of the desktop flashes.
The function is disabled for web content. Neither Gecko nor Internet Explorer supports this feature now for web content. getAttention
will still work when used from chrome in a Gecko application.
Specification
DOM Level 0. Not part of specification.
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Chrome
No support No |
Edge
No support No |
Firefox
No support No |
IE
No support No |
Opera
No support No |
Safari
No support No |
WebView Android
No support No |
Chrome Android
No support No |
Firefox Android
No support No |
Opera Android
No support No |
Safari iOS
No support No |
Samsung Internet Android
No support No |
Legend
- No support
- No support
- Non-standard. Expect poor cross-browser support.'
- Non-standard. Expect poor cross-browser support.
Window.getAttention() by Mozilla Contributors is licensed under CC-BY-SA 2.5.