button click scroll to top jquery code example
Example 1: javascript go to top of page
window.scroll({
top: 0,
left: 0,
behavior: 'smooth'
});
Example 2: scroll to top jquery
window.scrollTo({top: 0, behavior: 'smooth'});
reference : https://stackoverflow.com/questions/15935318/smooth-scroll-to-top