What is the JavaScript to scroll to the top when a button/link/etc. is clicked?
<a href="javascript:scroll(0, 0)">Top</a>
If you had an anchor link at the top of the page, you could do it with anchors too.
<a name="top"></a>
<a href='#top">top</a>
It'll work in browser's with Javascript disabled, but changes the url. :( It also lets you jump to anywhere the name anchor is set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With