scroll to top of page javascript when click code example
Example 1: javascript scroll to top of page
//Instant scroll to top of page
window.scrollTo(0, 0);
Example 2: javascript scroll to top onclick
$("#scroll_icon").click(function()
{
jQuery('html,body').animate({scrollTop:0},2000);
})