history.back()

In this chapter you will learn:

  1. How to use history back method

Back a step

We can use history.back() method to go one step back. history.back() mimics the browser Back button.

<!DOCTYPE HTML> <!--   j  a v a2 s.c  o m-->
<html> 
    <body> 
        <script type="text/javascript"> 
             //go back one page 
             window.history.back(); 
        </script> 
    </body> 
</html>

Click to view the demo

Next chapter...

What you will learn in the next chapter:

  1. How to use history forward method
Home » Javascript Tutorial » History
History Object
history.back()
history.forward
history.go(url/number)
history.length
history.pushState