files/en-us/web/api/history/back/index.md
{{APIRef("History API")}}
The back() method of the {{domxref("History")}} interface causes
the browser to move back one page in the session history.
It has the same effect as calling {{domxref("History.go", "history.go(-1)")}}. If there is no previous page, this method call does nothing.
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.
back()
None.
None ({{jsxref("undefined")}}).
SecurityError {{domxref("DOMException")}}
The following short example causes a button on the page to navigate back one entry in the session history.
<button id="go-back">Go back!</button>
document.getElementById("go-back").addEventListener("click", () => {
history.back();
});
{{Specifications}}
{{Compat}}