Java Script History List

In any browser we get the History option to see the browsing history of the visitors used that browser on that system. In JavaScript, the history object makes that list accessible.

The properties and methods
Name Description
length Length of history list
back ( ) Loads previous URL in history list
forward ( ) Loads next URL in history list
go ( ) Loads the URL indicated by an offset from the current place in the history list

The method history.back() goes to the previous page where as history.go(-4) goes to the page visited four pages back in the history list and so history.go(3) goes three URLs forward in the history list.

The history object is used to provide buttons that enable back and forth traversing in a website.