1window.scroll({top: 0, left: 0});
2//Or with jQuery
3$('html,body').scrollTop(0);
4//with animation
5$('html, body').animate({ scrollTop: 0 }, 'fast');
1//EITHER:
2
3window.scroll({
4 top: 0,
5 left: 0,
6 behavior: 'smooth'
7});
8
9//*****************************
10//OR:
11
12window.scroll({top: 0, left: 0});
13//Or with jQuery
14$('html,body').scrollTop(0);
15//with animation
16$('html, body').animate({ scrollTop: 0 }, 'fast');