JSFiddle - React, Tailwind, and code Playground
HTML
<div id="top">top</div>
<div id="bottom">bottom</div>
CSS
#top {
border: 1px solid black;
height: 3000px;
}
#bottom {
border: 1px solid red;
}
JavaScript
function top() {
document.getElementById( 'top' ).scrollIntoView();
};
function bottom() {
document.getElementById( 'bottom' ).scrollIntoView();
window.setTimeout( function () { top(); }, 2000 );
};
bottom();