How to scroll to the top of a webpage using JavaScript?
Originally Published Here ๐!
To scroll to the top of a webpage using JavaScript, you can use the scrollTo() method in the global window object and pass 0 as the first and second argument to the method.
// Scroll to Top of webpage
window.scrollTo(0, ...
melvingeorge-me.hashnode.dev1 min read