The Document.hidden
read-only property returns a Boolean value indicating if the page is considered hidden or not.
Syntax
var boolean = document.hidden
Examples
document.addEventListener("visibilitychange", function() {
console.log( document.hidden );
// Modify behavior...
});
Specifications
Browser compatibility
| Desktop | Mobile |
---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | Android webview | Chrome for Android | Firefox for Android | Opera for Android | Safari on iOS | Samsung Internet |
---|
hidden | Chrome
Full support
33-
Full support
33
-
Full support
13
- Prefixed Implemented with the vendor prefix: webkit
| Edge
Full support
12 | Firefox
Full support
18-
Full support
18
- Notes Since Firefox 56 it also returns
true on Mac when the window is completely hidden by another non-translucent application. -
No support
10 — 52
- Prefixed Implemented with the vendor prefix: moz
| IE
Full support
10 | Opera
Full support
12.1 | Safari
Full support
7 | WebView Android
Full support
Yes | Chrome Android
Full support
33-
Full support
33
-
Full support
Yes
- Prefixed Implemented with the vendor prefix: webkit
| Firefox Android
Full support
18-
Full support
18
- Notes Since Firefox 56 it also returns
true on Mac when the window is completely hidden by another non-translucent application. -
No support
10 — 52
- Prefixed Implemented with the vendor prefix: moz
| Opera Android
Full support
12.1 | Safari iOS
Full support
7 | Samsung Internet Android
Full support
2.0-
Full support
2.0
-
Full support
1.0
- Prefixed Implemented with the vendor prefix: webkit
|
---|
Legend
-
Full support
- Full support
- See implementation notes.
- See implementation notes.
- Requires a vendor prefix or different name for use.
- Requires a vendor prefix or different name for use.