Href button | Sololearn: Learn to code for FREE!


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 (switch at bottom)

1/13/2019 10:32:34 AM

∞ Infinítє Сσdєr ∞

2 Answers

New Answer


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