Checking support...
Feature Not SupportedThis browser does not support the Element Visibility Web API feature. Try testing in a modern browser (such as Chrome, Edge, Safari, or Firefox).
Advertisement
Interactive Input Workspace
Ready for input
Web API Execution Output
Result output will be displayed here after processing...
Native JavaScript Code Example (Zero Libraries)
const rect = element.getBoundingClientRect(); const isVisible = rect.top >= 0 && rect.bottom <= window.innerHeight;
About the Element Visibility Web API
getBoundingClientRect returns the size of an element and its position relative to the viewport.
Specification:W3C & WHATWG Web API Standard
Sponsored Content