History Object

How to go backward or forward pages using javascript?

Explanation

History Object has the complete list, information of url/links visited during this session. Its methods or functions can be used to move forward(next page) or backward(previous page). We can also go to any link or url page in the history list.
It also has the following properties
PropertyDescription

next
Property "next" represents the next page url in the history object list, if any.

previous
Property "previous" represents the previous page url in the history object list, if any.

current
Property "current" represents the current page url in the history object

length
Property "length" returns the number of objects in the history list.

Methods or Function:


The following are the methods defined under history object.

Ask Questions

Ask Question