What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-08 16:58:11
Scroll to the top of the page using JavaScript?
// Get The Id var topPage = document.getElementById(`top-page`) // On Click, Scroll to the Top of Page topPage.onclick = () => window.scrollTo({ top: 0, behavior: 'smooth' }) // On scroll, Show/Hide the button window.onscroll = () => { window.sc... Add solution