JSFiddle - React, Tailwind, and code Playground
by webvitaly
HTML
<a name="top"></a>
<p>scroll to bottom of the page and click the "back to top" link</p>
<p>===</p>
<p>----------------------</p>
<p>scroll to bottom of the page and click the "back to top" link</p>
<p>===</p>
<p>----------------------</p>
<p>scroll to bottom of the page and click the "back to top" link</p>
<p>===</p>
<p>----------------------</p>
<p>scroll to bottom of the page and click the "back to top" link</p>
<p>===</p>
<p>----------------------</p>
<p>scroll to bottom of the page and click the "back to top" link</p>
<p>===</p>
<p>----------------------</p>
<p>scroll to bottom of the page and click the "back to top" link</p>
<p>===</p>
<p>----------------------</p>
<p>scroll to bottom of the page and click the "back to top" link</p>
<p>===</p>
<p>----------------------</p>
<p>scroll to bottom of the page and click the "back to top" link</p>
<p>===</p>
<p>----------------------</p>
<p>scroll to bottom of the page and click the "back to top" link</p>
<p>===</p>
<p>----------------------</p>
<p>scroll to bottom of the page and click the "back to top" link</p>
<p>===</p>
<p>----------------------</p>
<p>scroll to bottom of the page and click the "back to top" link</p>
<p>===</p>
<p>----------------------</p>
<p>scroll to bottom of the page and click the "back to top" link</p>
<p>===</p>
<p>----------------------</p>
<p>scroll to bottom of the page and click the "back to top" link</p>
<p>===</p>
<p>----------------------</p>
<p>scroll to bottom of the page and click the "back to top" link</p>
<p>===</p>
<p>----------------------</p>
<p>scroll to bottom of the page and click the "back to top" link</p>
<p>===</p>
<p>----------------------</p>
<p>scroll to bottom of the page and click the "back to top" link</p>
<p>===</p>
<p>----------------------</p>
<p>scroll to bottom of the page and click the "back to top" link</p>
<p>===</p>
<p>----------------------</p>
<p>scroll to bottom of the page and click the "back to top"...
JavaScript
$('a[href=#top]').click(function(){
$('html, body').animate({scrollTop:0}, 1000);
return false;
});