forward() function is used in javscript to go to the next page in the history list. This does the same function as of next button in the browser window. Code: history.forward();
Example:
To create a button that takes to the next page when users click on it using javascript.
To test this go to next web page, come back and do the testing
In the above example a) we created a button b) added an onClick event listener to the button. c) when user clicks on the button the javascript function gonext() will be invoked. d) in the gonext() function we call history.forward().