// Js
document.getElementById('id').scrollIntoView();
// JQuery
$('#id')[0].scrollIntoView();
$("#button").click(function() {
$('html, body').animate({
scrollTop: $("#myDiv").offset().top
}, 2000);
});
const element = document.getElementById('anchor-name')
element.scrollIntoView({ behavior: 'smooth', block: 'start' });