Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

History length property

History length property

History Object Reference 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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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 Reference History object