0
Href button
href=#top in my switch doesnt work How do i make an element take me to the top of the page when i click it https://code.sololearn.com/WgQC6iYwntCo/?ref=app (switch at bottom)
2 ответов
+ 3
You have given the address as #top but there is no element with the id top. Create that in the top of the body.
But the formal way of getting top is using js.
Use document.scrollTop = 0 to go to top
0
ohh thanks