I am trying to use jQuery to scroll the page automatically back to the top when the page is loaded. Here is my code:
<script type="text/javascript">
$(document).ready(function () {
$(window).scrollTop(0);
return false;
});
</script>
However, the code does not work.
I have also tried to replace $(window)
to $('html, body')
,
sadly it still does not work.
So could anyone advice on this? Thanks a lot!