JSFiddle - React, Tailwind, and code Playground
HTML
<div>
hello.
<button>scroll to paragraph</button>
</div>
<p>bau</p>
CSS
div {
height: 1000px;
background-color: red;
padding: 1em;
}
JavaScript
$(document).ready(function() {
$('button').on('click', function() {
$("html, body").animate({ scrollTop: $('p').position().top }, 1000);
});
});