'Go Back' Button

 

All browsers already have "back" buttons, but perhaps you would like to put a link on your page that will take visitors back to the previous page that they were on; one that works just like the browser back button.

Our sample button below does just that. Whatever page that you were on prior to coming to this page, the button (just like the browser back button) will return you to it.

✪ TAKE ME BACK ✪

Sample Go Back Button

html
  1. <a class="btn btn-main" href="#" onclick="history.go(-1);return false;">&#10026; TAKE ME BACK &#10026;</a>
  2. <!-- The stars are done by entering the HTML entity code -->

That's all there is to it, the browser stores the list of all of the pages that you have visited in its history and the "history.go(-1)" tells the browser that you want the -1 entry from the history which corresponds to the previous page. Note You can also modify the button or link to take you forward (like the browser forward button) using "history.go(1)".