The Window scrollTo() method is used to scroll to a particular set of coordinates in the document.
Parameters: The scrollTo() method accepts two parameters as described below:
- x-coord: It is the pixel along the horizontal axis of the document that is displayed in the upper left. It is the required field.
- y-coord: It is the pixel along the vertical axis of the document that is displayed in the upper left. It is the required field.
Before clicking the button:
After clicking the button:
Supported Browsers: The browser supported by Window scrollTo() Method are listed below:
- Google Chrome
- Internet Explorer
- Firefox 1.0