MDN self-hosted library · e01.org

History: forward() method

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

html
<button id="go-forward">Go Forward!</button>
js
document.getElementById("go-forward").addEventListener("click", (e) => {
  history.forward();
});