Kmspico Download | Official KMS Activator Website [New Version 2024] Fast and Easy Converter YouTube to MP3 Online KMSAuto Net Activator Download 2024 Immediate Byte Pro Neoprofit AI Blacksprut without borders. Discover new shopping opportunities here where each link is an entrance to a world ruled by anonymity and freedom.

How to Scroll to the Top of the Page Using JavaScript or Jquery With Demo?

Hello friends, today I will tell you through this post how you to scroll the top of the page Using Javascript or Jquery. So let’s go.

You can scroll the page to the top very easily with javascript. Now I will tell you in 2 steps how to do it. So let’s go.

Step 1:- Create HTML File Write HTML Code(scroll-top-page.html).
Step 2:- Add JavaScript Code.

Step 1:- Create HTML File Write HTML Code(scroll-top-page.html).

 

<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<meta charset="utf-8">
<title>Scroll to the top of the page with jQuery</title>
</head>
<body>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<p>jquery scroll top of the page</p>
<a href='#top'>Go To Top</a> 
</body>
</html>

Step 2:- Add JavaScript Code.

 

<script>
$("a[href='#top']").click(function() { 
$("html, body").animate({ scrollTop: 0 }, "slow"); 
return false; });
</script>