files/en-us/web/api/window/scrollto/index.md
{{APIRef}}
Window.scrollTo() scrolls to a particular set of
coordinates in the document.
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")}}).
window.scrollTo(0, 1000);
Using options:
window.scrollTo({
top: 100,
left: 100,
behavior: "smooth",
});
{{domxref("Window.scroll()")}} is effectively the same as this method. For relative scrolling, see {{domxref("Window.scrollBy()")}}, {{domxref("Window.scrollByLines()")}}, and {{domxref("Window.scrollByPages()")}}.
For scrolling elements, see {{domxref("Element.scrollTop")}} and {{domxref("Element.scrollLeft")}}.
{{Specifications}}
{{Compat}}