1. Computing

Create a Back Button

Get a Back Button for Your Web Page

By

Create a Back Button Guestbook Graphics http://www.bordersetsbyinge.nl/guestbookgraphics1.htm

Create a back button right on your Web page. This button, when clicked, will take the reader back to the page they were on before they came to your page, wherever they came from.

This back button code works just like your browser's back button. It reads from your browser's history and sends the reader back to whence they came.

Basic Back Button Code

The basic code for a back button link is a very simple JavaScript. All you have to do with this back button JavaScript is copy the code and paste it where you want the back button link to show on your Web page.

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

Use a Button or Image

Maybe instead of using plain text for your back button code you want to use a button image or some other image as your back button. In this case you need to add an image code into the back button code.

The image code replaces the part of the back button code where you see the words Go Back. Just delete Go Back from the back button code and put the image code in it's place.

In the image code below you see http://webserver.com/name_of_graphic.gif. This is where you put the URL (Web address) of the image you want to use for your back button. This is what the image code looks like:

<img src="http://webserver.com/name_of_graphic.gif">

Putting the Code Together

This is what your entire code will look like if you're using a button image or other image for your back button instead of text.

<a href="javascript:history.go(-1)"><img src="http://webserver.com/name_of_graphic.gif"></a>

©2014 About.com. All rights reserved.