<button id="go-forward">Go Forward!</button>History: forward() method / notebook
History: forward() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
document.getElementById("go-forward").addEventListener("click", (e) => {
history.forward();
});