Below the body is a hidden anchor tag:
<a id="top"></a>
Put an access link at the bottom of the page:
<a href="#top">返回顶部</a>
Click `return to the top 'page to navigate to the a#top location.
document.documentElement.scrollTop = 0
scrollTo(0, 0)
window.scrollBy({ top: -document.documentElement.scrollTop })
Options parameter Smooth scrolling
window.scrollBy({
top: -document.documentElement.scrollTop,
behavior: "smooth"
})