Beispiel:
<HTML> <HEAD> <TITLE>Beispiel zu history</TITLE> <SCRIPT> var ziel function irgendwo() { ziel = parseInt(prompt("Wieviele Schritte zurück?","")) if (ziel >= 0 && ziel < history.length) { history.go(-ziel) } else { document.write("Nur 0 bis ",history.length-1," ist zulässig.<br>") } } </SCRIPT> </HEAD> <BODY> <FORM> <INPUT TYPE=button VALUE="Zurück" ONCLICK=history.back()> <INPUT TYPE=button VALUE="Irgendwohin" ONCLICK=irgendwo()> <SCRIPT> document.write(history.length," History-Einträge sind vorhanden.<br>") </SCRIPT></FORM></BODY></HTML>