

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to Scroll to the top of the page using JavaScript/ jQuery?
Example
<html> <body> <script> $("a").click(function() { $("html, body").animate({ scrollTop: 0 }, "slow"); return false; }); </script> <h3>TOP OF PAGE</h3> <br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text.<br> This is demo text. <br> <h3>BOTTOM OF PAGE</h3> <a href="#">Scroll up</a> </body> </html>
- Related Questions & Answers
- How to scroll down the page till page end in the Selenium WebDriver?
- How to find horizontal Scroll Position using jQuery?
- How to scroll the Page up or down in Selenium WebDriver using java?
- How to scroll to element in horizontal div using jQuery?
- How to loop through all the iframes elements of a page using jQuery?
- How to loop through all the image elements of a page using jQuery?
- How to Scroll top in RecyclerView with LinearLayoutManager
- How to make a page redirect using jQuery?
- How to use multiple versions of jQuery on the same page?
- How to scroll a Web Page using coordinates of a WebElement in Selenium WebDriver?
- How to scroll up/down a page using Actions class in Selenium?
- How to find left position of element in horizontal scroll container using jQuery?
- How to load a page in div using jQuery?
- How to stop the loop for JavaScript scroll down?
- How to set scroll left position in jQuery?
Advertisements