History length property
History object
Definition and Usage
The length property declares the number of elements in the browser history list.
Note: Internet Explorer and Opera start from 0, while Firefox, Chrome and Safari start from 1.
Syntax
history.length
Browser support





All major browsers support the length property.
Example
Example
Return the number of URLs in the history list:
The example above produces the following output:
Try it »
History object