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

History back() method

History back() method

History Object Reference History object


Definition and Usage

The back() method loads the previous URL in the history list (if it exists).

Calling this method is equivalent to clicking the back button or calling history.go(-1).

Syntax

history.back()


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the back() method


Example

Example

Create a back button on the page:

Runoob Tutorial(runoob.com)

The example above produces the following output:

Try it »


History Object Reference History object