I volontari di MDN non hanno ancora tradotto questo articolo in Italiano. Unisciti a noi e traducilo tu stesso.
Puoi anche consultare l’articolo in English (US).

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.

Syntax

var element = document.scrollingElement;

Example

var scrollElm = document.scrollingElement;
scrollElm.scrollTop = 0;

Specifications

Specification Status Comment
CSS Object Model (CSSOM) View Module
The definition of 'scrollingElement' in that specification.
Working Draft Initial definition

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 44Edge Full support YesFirefox Full support 48
Full support 48
No support 47 — 48
Disabled
Disabled From version 47 until version 48 (exclusive): this feature is behind the dom.document.scrollingElement.enabled preference. To change preferences in Firefox, visit about:config.
IE No support NoOpera Full support 31Safari Full support 9WebView Android Full support 44Chrome Android Full support 44Edge Mobile Full support YesFirefox Android Full support YesOpera Android Full support 31Safari iOS Full support 9Samsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
User must explicitly enable this feature.
User must explicitly enable this feature.

Tag del documento e collaboratori

Hanno collaborato alla realizzazione di questa pagina: russelldavis, fscholz, jaffathecake, erikadoyle, Sebastianz, DevelX, massic80, rolfedh, m_gol, teoli, jpmedley
Ultima modifica di: russelldavis,