Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Back Button

Status
Not open for further replies.

alexanderdring

Technical User
Dec 27, 2002
36
FR
Hello everyone,

Just a quick question; does anyone know how to create an intelligent "back" button in XHTML/CSS that actually returns to the previous page on a site rather than a specific link? I'm sure there's a fairly simple piece of javascript but I haven't been able to find anything. I'd really appreciate any help anyone could provide.

Thanks!

Alex.
 
This should really be in forum216 but try:
<a href="javascript:history.back()">Back</a>

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
You can't in XHTML/CSS, like you mentioned yourself. You need employ javascript. You could try either:
Code:
<a href="javascript:history.go(-1);">back</a>
or
<a href="javascript:history.back();">back</a>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top