History go() method
History object
Definition and Usage
The go() method loads a specific page in the history list.
The parameter can be a number, representing the relative position of the URL to be accessed in the History URL list. (-1 for the previous page, 1 for the next page). Or it can be a string, which must be a partial or complete URL, and the function will match the first URL that contains the string.
Syntax
history.go(
number
|
URL
)
Browser support





All major browsers support the go() method
Example
Example
Click to go back two pages:
The example above produces the following output:
Try it »
History object