English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

JavaScript History forward() Method

HTML History Object

forward()Method to load the next URL in the history list.

This is the same as clicking the 'Forward Button' in the browser or ' history.go('1Click the 'Forward Button' in the parenthesis)

Note:This method will not work if there is no next page in the history record list.

To load a previous URL in the history record list, usehistory.back()Method.

Syntax:

history.forward()
<button onclick="history.forward();">Go Forward</button>
Test See </›

The following output will be displayed by the code above (this example will not work if there is no next page in the history record list):

Browser Compatibility

All browsers fully support the forward() method:

Method
history.forward()YesYesYesYesYes

Technical Details

Return Value:None

Related References

History Record Reference:history.back() Method

History Record Reference:history.go() Method

HTML History Object