scroll through page with javascript code example Example: scroll through page with javascript window.scroll({ top: 0, left: 0, behavior: 'smooth' });