English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
back()method to load the previous URL in the history list.
This is the same as loading the previous URL in the history list in the browser or by using the-1Clicking the 'Back' button in the parentheses is the same as clicking
Note:This method will not work if the previous page is not in the history list.
To load the next URL in the history list, usehistory.forward()Method.
history.back()
<button onclick="history.back();">Go Back</button>Test to see‹/›
The following output will be displayed by the above code:
All browsers fully support the back() method:
Method | |||||
history.back() | Yes | Yes | Yes | Yes | Yes |
Return Value: | None |
---|
History Record Reference:history.forward() Method
History Record Reference:history.go() Method