Href button | Sololearn: Learn to code for FREE!

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)

1/13/2019 10:32:34 AM

∞ Infinítє Сσdєr ∞

2 Answers

New Answer

+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