# Document: scrollingElement property



The **`scrollingElement`** read-only property of the
[Document](https://developer.mozilla.org/en-US/docs/Web/API/Document) interface returns a reference to the [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) that
scrolls the document. In standards mode, this is the root element of the
document, [document.documentElement](https://developer.mozilla.org/en-US/docs/Web/API/document/documentElement).

When in quirks mode, the `scrollingElement` attribute returns the HTML
`body` element if it exists and is _not_ [potentially scrollable](https://drafts.csswg.org/cssom-view/#potentially-scrollable), otherwise it returns `null`. This may look surprising but is true according to both the specification and browsers.

## Value

The [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) that scrolls the document, usually the root element (unless not in standard mode).

## Examples

```js
const scrollElm = document.scrollingElement;
scrollElm.scrollTop = 0;
```

## Specifications

## Browser compatibility
