Scroll to bottom with JavaScript

Use JavaScript to scroll to the bottom of the page automatically.

In order to automatically scroll to the bottom of the page, you can use the native function scrollTo method of the window object, which accepts either two parameters describing the x and y coordinates or one options parameter.

options: {  
 top: number,
 left: number,
 behavior: ‘smooth’ | ‘auto’
})