move scroll to top javascript code example
Example 1: javascript scroll to top of page
//Instant scroll to top of page
window.scrollTo(0, 0);
Example 2: scrool to top jquerry
$("a[href='#top']").click(function() {
$("html, body").animate({ scrollTop: 0 }, "slow");
return false;
});