JSFiddle - React, Tailwind, and code Playground
by Mark Coleman
HTML
<div class="b"></div>
<div id="go-to-top">top</div>
CSS
.b
{
display:block;
height:1000px;
}
JavaScript
$('#go-to-top').click(function() {
$(window.opera ? 'html' : 'html, body').animate({
scrollTop: 0
}, 'slow');
});