Back to Previous Page

 

Back to Previous Page

Back to previous page code will enable your visitors to click on a button, link or image to be taken back to the previous page they were on. This JavaScript code is great for use in pop up windows when you’re running image slide shows, displaying multiple tips, step by step instructions or whatever you’d like.

Back to the Previous Page with a Button

Back

Copy and paste this code into your HTML where you would like the button to appear:

<form>
<input type="button" value="Back to Previous Page"
onClick="javascript: history.go(-1)">
</form>

 

Back to the Previous Page with a Link

The following JavaScript code will enable your visitors to click on a link to be taken back to the previous page they were on.

Back

Copy and paste this code into your HTML where you would like the link to appear:

<a href="javascript: history.go(-1)">Back</a>

Back to the Previous Page with an Image

You can enable your visitors to click on an image to be taken back to the previous page they were on.

Copy and paste this code into your HTML where you would like the image to appear:

<a href="javascript: history.go(-1)"><img border="0" src="yourimage.gif" width="20" height="20"></a>

Edit the text indicated in bold to suit your needs. The yourimage.gif text should be replaced with the name of your image, which resides on your server.

Using this little JavaScript snippet is a great way to enable your visitors to navigate your website.

This concludes the Back to Previous Page code.
 

 

 

 

 
Visit the following pages for a wealth of copy and paste codes and tips:

HTML Tips
Copy and paste special effect HTML codes for your web page.

HTML Codes
An HTML codes chart you can use to copy and paste codes into your web page.

HTML Color Codes
An HTML color codes chart you can use to copy and paste color codes into your web page.

JavaScript Codes
Copy and paste special effect JavaScript codes for your web page.

Web Design Tips
Tips, tricks, and special effect codes for your web page.

HTML Tags
A list of HTML tags.

HTML 5 Tags
A list of the latest HTML tags to be developed.

ASCII Codes
Special text characters and code for your web page.