HTML DOM document scrollingElement Property
The scrollingElement property of the document returns a reference to the element that scrolls the document.
In standards mode, this is the root element of the document. Whereas in quirks mode, It returns the HTML body element or NULL.
var elem = document.scrollingElement;
- In standards mode, It returns the root element of the document.
- In quirks mode, It returns the HTML body element or NULL.
Example: In this Example, we are getting the scrolling element using this property.
Before Click the Button:
After Click the Button:
- Google Chrome