To make an HTML back link with JavaScript, we call the history.back
method on click.
For instance, we write
<a href="javascript:history.back()">Go Back</a>
to set the href
attribute to the JavaScript code that calls the history.back
method to go back to the previous page when we click on the link.