Hi! I'm trying to create a button that returns a u...
# javascript
h
Hi! I'm trying to create a button that returns a user to the top of the webpage. document.documentElement?.scrollTop = 0.0 is the slightly edited code I'm using from https://www.w3schools.com/howto/howto_js_scroll_to_top.asp but I'm having trouble implementing in Kotlin. Have you got any ideas?
g
What kind troubles? This code looks fine
h
It recognises the click but then doesn't scroll to the top
g
Does it work for you on pure JS? Did you try to debug?