You are on page 1of 3

History Object

The History object is a read-only array of URL string that show where the user
has been recently.
Syntax: -
window.history.property
window.history.method
Property
• length – It returns the number of URLs in the history list.
Methods
• back ( ) – It loads the previous URL in the history list.

• forward ( ) – It loads the next URL in the history list.

• go ( ) – It access a particular item in the history list relative to the current


position. Using a negative value moves to a history item previous to the
current location, while a positive number moves forward in the history list.

You might also like