smooth scrolll to top with js code example Example: javascript scroll to top smooth window.scrollTo({top: 0, behavior: 'smooth'});