Baseline Widely available
The scrollingElement
read-only property of the Document
interface returns a reference to the Element
that scrolls the document. In standards mode, this is the root element of the document, document.documentElement
.
When in quirks mode, the scrollingElement
attribute returns the HTML body
element if it exists and is not potentially scrollable, otherwise it returns null
. This may look surprising but is true according to both the specification and browsers.
The Element
that scrolls the document, usually the root element (unless not in standard mode).
const scrollElm = document.scrollingElement;
scrollElm.scrollTop = 0;
Specifications Browser compatibility
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4