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

Specification Status Comment
Page Visibility (Second Edition)
The definition of 'Document.hidden' in that specification.
Recommendation Initial definition

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support

33

13 webkit

Yes

181

10 — 52 -moz-

1012.17
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes Yes Yes

181

10 — 52 -moz-

12.17 ?

1. Since Firefox 56 it also returns true on Mac when the window is completely hidden by another non-translucent application.

Document Tags and Contributors

Contributors to this page: fscholz, aleclarson, Bzbarsky, Sebastianz, teoli
Last updated by: fscholz,