Windows history.length property
- Previous Page go()
- Next Page back()
- Go Up One Level Window History
Definition and usage
length
The property returns the number of URLs in the current browser window's history list.
This property returns at least 1, because the list includes the current page.
This property is very useful for finding out how many pages the user has visited in the current browsing session.
Tip:history.back()
Valid only if there is a previous page in the history list.
See also:
Syntax
history.length
Parameter
None.
Return value
Type | Description |
---|---|
Number | The number of entries in the history list. |
Browser Support
All Browsers Support history.length
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Previous Page go()
- Next Page back()
- Go Up One Level Window History