Nuestros voluntarios aún no han traducido este artículo al Español. ¡Únete a nosotros y ayúdanos a traducirlo!
También puedes leer el artículo en English (US).

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

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 33
Full support 33
Full support 13
Prefixed
Prefixed Requires the vendor prefix: webkit
Edge Full support YesFirefox Full support 18
Notes
Full support 18
Notes
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
Prefixed Requires the vendor prefix: -moz-
IE Full support 10Opera Full support 12.1Safari Full support 7WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 18
Notes
Full support 18
Notes
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
Prefixed Requires the vendor prefix: -moz-
Opera Android Full support 12.1Safari iOS Full support 7Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

Etiquetas y colaboradores del documento

Colaboradores en esta página: fscholz, aleclarson, Bzbarsky, Sebastianz, teoli
Última actualización por: fscholz,