JS window.history.forward() Method

This is an example page to demonstrate how window.history.forward() method works

Page 1 Page 2

Note

'Go Forward' button will not work for the first time as the next page does not exist in the history list.

  1. Click on either 'Page 1' or 'Page 2' link.
  2. You will land on the 'window.history.back() Method' demo page.
  3. Click on 'Go Back' Button
  4. You will land on this page.
  5. Now, click on 'Go Forward' Button

Press ctrl + u to view page source code