Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML DOM document scrollingElement Property

  • Last Updated : 05 Jul, 2020

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.

Hey geek! The constant emerging technologies in the world of web development always keeps the excitement for this subject through the roof. But before you tackle the big projects, we suggest you start by learning the basics. Kickstart your web development journey by learning JS concepts with our JavaScript Course. Now at it's lowest price ever!


var elem = document.scrollingElement;

Return Value:

  • 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.


<!DOCTYPE html>
    <button onclick="get()">
        Get ScrollingElement
    <script type="text/javascript">
        function get() {
            var Elm = document.scrollingElement;
            Elm.scrollTop = 0;


  • Before Click the Button:

  • After Click the Button:

Supported Browsers:

  • Google Chrome
  • Edge
  • Firefox
  • Opera
  • Safari
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!