$("my-element").click(function () {
$("html, body").animate({
scrollTop: 0
}, 1000)
})
window.scrollTo({top: 0, behavior: 'smooth'});
reference : https://stackoverflow.com/questions/15935318/smooth-scroll-to-top
$("a[href='#top']").click(function() {
$("html, body").animate({ scrollTop: 0 }, "slow");
return false;
});
window.scrollTo({ top: 100, left: 100, behavior: 'smooth' });