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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the scroll method on the window object to do this:
The arguments are the horizontal and vertical measure of scrolling within the window, so 0,0 brings it back to the top.