Javascript (The browser objects): The History object

April 2018

The history object is a property of the document object. It contains the history of the browser, that is to say all the URLs visited by the user. These addresses can be accessed via the browser by clicking on the Next and Back buttons.

The history object has objects and methods to navigate through this address list directly from the current page.
The properties and methods of the object history are few in numbers, but still can be very useful for navigating through webpage*.
  • The length property allows you determine the number of objects in history
  • The back method allows you to go back to the previous URL in the history
  • The forward method allows you to go back to the next URL in the history
  • The go method(variable) allows you to access a particular URL in the history.
    • The variable parameter is an integer (positive or negative) which determines the number of pages on which the desired URL is found.
  • Note that: On some browsers, when security level is enabled, this method won't give any results.

Original document publishe on
Published by jak58. Latest update on May 8, 2013 at 10:37 AM by jak58.
This document, titled "Javascript (The browser objects): The History object," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (
Javascript - The core objects
JavaScript - Arrays