History Object
The history object records the pages (URLs) that the user has browsed, and enables the browser to move forward and backward with similar navigation capabilities.
Note: starting from the moment the window is opened, each browser window, every tab, and even each frame has its own history object associated with a particular window object.
Grammar:
Window.history. [Properties | method]
Note:window can be omitted.
History Object Properties
Length: Returns the number of URLs in the browser history list
History Object method
Back () load the previous URL in the history list
Forward () load the next URL in the history list
Go () Load a page from the history list
Total length of browsing history for the current window using the Length property
History Object method
<script type= "Text/javascript" > var HL = window.history.length;// windows can also not write document.write (HL);</script>
---restore content ends---
JavaScript Browser object: History