JSFiddle - React, Tailwind, and code Playground

by karim79

HTML

<div style="height:1000px">



</div>
<p>test</p>

JavaScript

var offset = $("p").offset();
$("html,body").animate({
    scrollTop: offset.top,
    scrollLeft: offset.left
});