JSFiddle - React, Tailwind, and code Playground
by slawe
HTML
<div class="first"><button type="button">Click Me!</button></div>
<div class="second">Hi</div>
CSS
.first {
width: 100%;
height: 1000px;
background: #ccc;
}
.second {
width: 100%;
height: 1000px;
background: #999;
}
JavaScript
$("button").click(function() {
$('html,body').animate({
scrollTop: $(".second").offset().top},
'slow');
});