documentdocumentElementoffsetHeight
document.documentElement.offsetHeight is a property that returns the height, in CSS pixels, of the root HTML element (the <html> element) as it is laid out by the browser. It includes the element’s vertical padding and borders, and is read from the DOM as a numeric value. The property is read-only and reflects the element’s rendered size at a given moment.
In practice, document.documentElement refers to the root of the document, and offsetHeight is one way to measure
Common use cases include simple layout calculations, responsive adjustments, and scroll-related logic where a stable metric
Usage example: var h = document.documentElement.offsetHeight;
Limitations include potential reflows when the page layout changes, and the fact that offsetHeight is only