You can use following code to scroll to ID of an element in HTML document
You need to make sure the Jquery is previously included above following code
// Add Smooth scrolling to all links
jQuery(“a”).on(‘click’, function(event) {
// Make sure this.hash has a value before overriding default behavior
if (this.hash !== “”) {
// Prevent default anchor click behavior
event.preventDefault();
// Store hash
var hash = this.hash;
jQuery(‘html, body’).animate({
scrollTop: jQuery(hash).offset().top
}, 1000, function(){
window.location.hash = hash;
});
} // End if
});
// End Smooth Scrolling