Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

History go() method

History go() method

History Object Reference 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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the go() method


Example

Example

Click to go back two pages:

Runoob Tutorial(runoob.com)

The example above produces the following output:

Try it »


History Object Reference History object