Easy Tutorial
❮ Prop Datetime Disabled Ref Charactersets ❯

Window scrollTo() Method


Definition and Usage

The scrollTo() method scrolls the content to the specified coordinates.

Syntax

Parameter Description
xpos Required. The x-coordinate of the document to be displayed at the top-left corner of the window.
ypos Required. The y-coordinate of the document to be displayed at the top-left corner of the window.

Browser Support

All major browsers support the scrollTo() method.


Example

Scroll the content to the coordinates 100, 500:

function scrollWindow(){
    window.scrollTo(100,500);
}

❮ Prop Datetime Disabled Ref Charactersets ❯