JSFiddle - React, Tailwind, and code Playground

by barrycorrigan

HTML

<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div id="div" class="bottom" style="background-color: black; color: white;">
STOP HERE
</div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />

<a href="#" class="no">Scroll Top</a>

JavaScript

$(document).on("click", '.no', function () {
        
       

        $('html, body').animate({
            //scrollTop: $(window).scrollTop(0)
       			scrollTop: $("div.bottom").offset().top 		
        }, 'slow');
        
        
       

        

        
        
    });