I have a button on a page and I want that when it is clicked, the page scrolls to the 0 position.
HTML
Back to top
Try It
$("#button").click(function() { $("html").scrollTop(0); });
or
$("#button").click(function() { $("html").animate({ scrollTop: 0 }, "slow"); });