+ 1

What is the "go up the page" function?

I am at the bottom of an web page. I want to go to the very up. I see the button "go up", I click on it and it takes me up to the begging. How can I make such a button in HTML? What's the code/name of a function to this?

22nd Oct 2019, 3:33 PM
Julia G ^_-
Julia G ^_- - avatar
4 ответов
+ 1
You create a button and bind its onclick to window.scrollTo(). https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo
22nd Oct 2019, 3:38 PM
Fermi
Fermi - avatar
+ 1
Thank you, I will try this!
22nd Oct 2019, 4:09 PM
Julia G ^_-
Julia G ^_- - avatar
+ 1
Do I locate the <a name="top"></a> Inside the /head or just after the /body tag?
22nd Oct 2019, 5:28 PM
Julia G ^_-
Julia G ^_- - avatar
+ 1
Ok, thank you, I will try this!
22nd Oct 2019, 8:57 PM
Julia G ^_-
Julia G ^_- - avatar