files/en-us/web/api/element/scrollto/index.md
{{APIRef("CSSOM view API")}}
The scrollTo() method of the {{domxref("Element")}}
interface scrolls to a particular set of coordinates inside a given element.
This method is an alias for {{domxref("Element.scroll()")}}.
scrollTo(xCoord, yCoord)
scrollTo(options)
xCoord
yCoord
options
top
left
behavior
smooth: scrolling should animate smoothlyinstant: scrolling should happen instantly in a single jumpauto: scroll behavior is determined by the computed value of {{cssxref("scroll-behavior")}}None ({{jsxref("undefined")}}).
element.scrollTo(0, 1000);
Using options:
element.scrollTo({
top: 100,
left: 100,
behavior: "smooth",
});
{{Specifications}}
{{Compat}}