JSFiddle - React, Tailwind, and code Playground

HTML

<html>
    <body>
    <div style="margin: 100px 100px 1000px 100px">
        <div id="test" style="width: 100px; height: 100px; border: 3px solid black;">target object</div>
    </div>
    </body>
</html>

JavaScript

function scrolear(destino){
    var stop = $(destino).offset().top;
    var delay = 1000;
    $('body,html').animate({scrollTop: stop}, delay);
    return false;
}

scrolear('#test');