JSFiddle - React, Tailwind, and code Playground

by Alin Guta

HTML

<div id="abc">Click me</div>
<div id="anchor"></div>

CSS

#anchor{
    width:100px;
    height:100px;
    margin:0 auto;
    position:relative;
    background:green;
    margin-top:2000px
}

JavaScript

$(function() {
    $("#abc").bind("click", function() {
        $("html, body").animate({
            scrollTop: $("#anchor").offset().top
        }, 500);
    });
})(jQuery);