This is the way I do it.
document.querySelector('scrollHere').scrollIntoView({ behavior: 'smooth' })
Works in any browser.
It can easily be wrapped into a function
function scrollTo(selector) {
document.querySelector(selector).scrollIntoView({ behavior: 'smooth' })
}
Here is a working example
$(".btn").click(function() {_x000D_
document.getElementById("scrollHere").scrollIntoView( {behavior: "smooth" })_x000D_
})
_x000D_
.btn {margin-bottom: 500px;}_x000D_
.middle {display: block; margin-bottom: 500px; color: red;}
_x000D_
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>_x000D_
_x000D_
<button class="btn">Scroll down</button>_x000D_
_x000D_
<h1 class="middle">You see?</h1>_x000D_
_x000D_
<div id="scrollHere">Arrived at your destination</div>
_x000D_