files/en-us/web/api/history/forward/index.md
{{APIRef("History API")}}
The forward() method of the {{domxref("History")}} interface causes the browser to move
forward one page in the session history. It has the same effect as calling
{{domxref("History.go", "history.go(1)")}}.
This method is {{glossary("asynchronous")}}. Add a listener for the {{domxref("Window/popstate_event", "popstate")}} event in order to determine when the navigation has completed.
forward()
None.
None ({{jsxref("undefined")}}).
SecurityError {{domxref("DOMException")}}
The following examples create a button that moves forward one step in the session history.
<button id="go-forward">Go Forward!</button>
document.getElementById("go-forward").addEventListener("click", (e) => {
history.forward();
});
{{Specifications}}
{{Compat}}