February 3, 2015

“Go Back” Button in Javascript

Browsers already have "back" button. Even though if you need a back button within your page you can try out this method.


<input type="button" value="Go Back!" onclick="history.back(-1)" />

The above is an html code for button with inline JavaScript.

This is totally obtrusive, but you could fix that by only appending this button through JavaScript.

No comments:

Post a Comment

Popular Posts