<button id="go-back">Go back!</button>History: back() method / notebook
History: back() 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-back").addEventListener("click", () => {
history.back();
});