history.forward

In this chapter you will learn:

  1. How to use history forward method

Forward a step

history.forward()

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

<!DOCTYPE HTML> <!--   j  ava  2  s  . c  om-->
<html> 
    <body> 
        <script type="text/javascript"> 
            //go forward one page 
            window.history.forward(); 
        </script> 
    </body> 
</html>

Click to view the demo

Next chapter...

What you will learn in the next chapter:

  1. How to use go method from history object
  2. How to pass in a URL to history go method
Home » Javascript Tutorial » History
History Object
history.back()
history.forward
history.go(url/number)
history.length
history.pushState