Hii @kartik,
Using javascript
<script>
$("a[href='#top']").click(function() {
$("html, body").animate({ scrollTop: 0 }, "slow");
return false;
});
</script>
However you don't need javascript to do this. A standard HTML tag will suffice..
<a href="#top">go top</a>
Thank You!!