<title>jQuery Page Scroll to Top</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.myTop').click(function(){
$("html, body").scrollTop(0);
<h2>jQuery Page Scroll to Top</h2>
<div>Scroll down to get the button to scroll to top.</div>
<div style="margin-top:300px;">Welcome to Tutorialdeep</div>
<div style="margin-top:300px;">How are you?</div>
<div style="margin-top:300px;">I am fine.</div>
<button type="button" class="myTop">Click to Scroll to Top</button>