Element.scroll() scrolls to a particular set of coordinates inside that element (MDN). Pass (x, y) or an options object with top, left, and behavior. It is an alias of scrollTo().
Pass the required arguments shown below. Check return values and browser support before you rely on the result.
Syntax
Call el.scroll. Start with this line.
JavaScript
el.scroll(x, y) or el.scroll(options)
Call
What it does
el.scroll(x, y) or el.scroll(options)
Primary signature.
el.scroll(...)
Call with the arguments your case needs.
Built into the browser. Call scroll(...) on an Element — no import required.
Library declarations
JavaScript
el.scroll(x, y) or el.scroll(options)
Parameters
Parameter
Description
options.behavior
Optional. smooth, instant, or auto
Promise interrupted
Optional. True if another scroll cut this one short
Return Value
Return Value
Description
*
Promise<{ interrupted }> (support varies)
JavaScript Examples
Example 1 — Scroll to Coordinates
MDN: put the 1000th vertical pixel at the top of the element.
Await finish. Useful for smooth scrolls that take time.
interrupted. True if another programmatic scroll started first.
Feature-detect. MDN: test box.scroll(0, 0) instanceof Promise.
Fallback. If no Promise, scroll still works — just no await.
Compatibility
Browser Support
Element.scroll() is Baseline Widely available (MDN, since January 2020). It is not Deprecated, Experimental, or Non-standard. Promise return / interrupted may vary — feature-detect if you depend on it.
✓ Baseline Widely available
Element.scroll()
Scroll an element to absolute coordinates or options. Alias of scrollTo(); pair with scrollBy for relative moves.
BaselineWidely available
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
Android WebViewSupported · Modern WebView
Full support
scroll()Baseline
Bottom line: Safe for modern apps. Prefer options + behavior for smooth UX; detect Promise support before awaiting.
Frequently Asked Questions
It scrolls an element to a particular set of coordinates inside that element (MDN). Pass x/y numbers or an options object with top, left, and behavior.
No. MDN marks Element.scroll() as Baseline Widely available (since January 2020). It is not Deprecated, Experimental, or Non-standard. Some parts (such as the Promise return) may vary by browser.
MDN documents a Promise that fulfills with { interrupted }. interrupted is true if another programmatic scroll started on the same element before the first finished. Feature-detect if you rely on the Promise.
Yes. MDN treats Element.scroll() as an alias of Element.scrollTo() — same syntax and behavior.
scroll() / scrollTo() move to absolute coordinates. scrollBy() moves by a relative delta from the current position.
Optional string: smooth (animate), instant (jump), or auto (use the element’s CSS scroll-behavior). Default is auto (MDN).