window.scrollTo(x,y)

window.scrollTo(x, y) scrolls to the specified position.

 
<!DOCTYPE HTML> 
<html> 
    <head> 
        <title>Example</title> 
    </head> 
    <body> 
        <p> 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
            This is a test. This is a test. This is a test. This is a test. This is a test. 
        </p> 
        <script> 
            window.scrollTo(0, 400); 
        </script> 
    </body> 
</html>
  
Click to view the demo
Home 
  JavaScript Book 
    DOM  

Window:
  1. The Window Object
  2. The Window Events
  3. window.alert() or alert()
  4. window.close()
  5. window.confirm() or confirm()
  6. window.find() displays find dialog
  7. window's outer width and height, inner height and width
  8. window.location
  9. window.moveBy(distance, distance)
  10. window.moveTo(x,y) moves the window to the upper-left coordinate
  11. window.open()
  12. window.print()
  13. window.prompt() and prompt()
  14. window.resizeTo(x,y) and window.resizeBy(xDelta,yDelta)
  15. window.scrollTo(x,y)
  16. window.screenLeft, window.screenX, window.screenTop, window.screenY
  17. window.setInterval() or setInterval()
  18. window.setTimeout() or setTimeout()
  19. Pop-up Blockers