JavaScript City


Back Button

This script will allow you to add a "back" button to your page that works like the browser's "back" button.

Script Code

Grab a copy of the file below and place it in the same directory as the Web page on which you will use the script (if you wish to place the script file in a different directory you will need to make the necessary adjustments to the src attribute of the script tag that calls it).

snavb1.js

The code below should be placed between the <body> and </body> tags where you want the button to appear.

Example

A working sample of the script is shown below.

Options

You can change the appearance of the button by adding the back_button id and to your style sheet and editing as desired.

To edit the text of the button, edit it's value attribute (default is Back).

Accessibility

The browser has the ability to do this, so some instructions for using the browser's "back" button might be helpful if the user does not have JavaScript enabled or is unable to run the script.



eXTReMe Tracker