coderef

checkVisibility()Baseline · Widely available

The checkVisibility() method checks if an element is potentially visible, with optional parameters for the kinds of visibility to check. For example, it checks whether the element has the style display: none, but can also check for visibility: hidden.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Mar 5, 2024. Widely available since Sep 5, 2026.

Browser support

DesktopChrome
1–104Not supported
105+Supportedsince Sep 2, 2022
Current: 155
Edge
12–104Not supported
105+Supportedsince Sep 1, 2022
Current: 154
Firefox
1–105Not supported
106+Supportedsince Oct 18, 2022
Current: 157
Safari
1–17.3Not supported
17.4+Supportedsince Mar 5, 2024
Current: 27
MobileChrome Android
18–104Not supported
105+Supportedsince Sep 2, 2022
Current: 155
Firefox Android
4–105Not supported
106+Supportedsince Oct 18, 2022
Current: 157
Safari iOS
1–17.3Not supported
17.4+Supportedsince Mar 5, 2024
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: checkVisibility.

Feature detection

JS · check before using
if ("Element" in globalThis && "checkVisibility" in Element.prototype) {
  // Element.checkVisibility is available
}

Sub-features

Support for each part of the feature (6). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Element.checkVisibility10510510617.410510617.4
Element.checkVisibility.options_checkOpacity_parameter10510510617.410510617.4
Element.checkVisibility.options_checkVisibilityCSS_parameter10510510617.410510617.4
Element.checkVisibility.options_contentVisibilityAuto_parameter12112112217.412112217.4
Element.checkVisibility.options_opacityProperty_parameter12112112217.412112217.4
Element.checkVisibility.options_visibilityProperty_parameter12112112217.412112217.4