Window history.forward() method
- Previous Page Back
- Previous Page Next Page
- Go to the Previous Level Window History
Definition and Usage
history.forward()
The method loads the next URL (page) in the history list.
history.forward()
The method is only valid when there is a next page.
Comment
history.forward()
Same as history.go(1)
Same.
history.forward()
Same as clicking the 'Forward' button in the browser.
See also:
Example
Create a forward button on the page:
<button onclick="history.forward()">Forward</button>
The output of the above code will be:
Click 'Forward' to see how it works.
(Only valid when there is a next page in your history list)
Syntax
history.forward()
Parameter
None.
Return value
None.
Browser Support
All Browsers Support history.forward()
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Previous Page Back
- Previous Page Next Page
- Go to the Previous Level Window History