Fri, 17 May 2024


How to create a custom Back button (which does the same as this in the browser)?

By: Anton, NetArt Media
Sun, 27 December 2020

If you wish to create you custom Back button to put in your page, you may use whatever graphic button or just a simple HTML button and you need to call (when an OnClick event occurs) the following code history.back()

Be aware that this is absolutely the same like if you call history.go(-1)

In general history.go(X) is more flexible because you could specify a custom value for X (the number of visited pages the user will go back)


Category: Javascript
Share this post:



See All Scripts






Subscribe for our newsletter

Receive the latest blog posts direct in your mailbox