I have an upload form -- after the user submits the form, I'd like to scroll the window back to the top of the page (where I display some help text). How do I correctly scroll the window back to the top of the page?
You can use the scroll method on the window object to do this:
window.scroll(0,0)
The arguments are the horizontal and vertical measure of scrolling within the window, so 0,0 brings it back to the top.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With