X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

History length Property

History Object Reference History Object

Example

Get the number of URLs in the history list:

var x = history.length;

The result of x could be:


Try it yourself »


Definition and Usage

The length property returns the number of URLs in the history list of the current browser window.

The property returns at least 1, because the list includes the currently loaded page.

Tip: This property is useful to find out how many pages the user has visited in the current browsing session.

Note: Internet Explorer and Opera start at 0, while Firefox, Chrome, and Safari start at 1.

Note: Maximum length is 50.

Note: This propertry is read-only.


Browser Support

Property
length Yes Yes Yes Yes Yes


Syntax

history.length

Technical Details

Return Value: A Number, representing the number of entries in the session history


History Object Reference History Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook