History length property
Definition and Usage
length attribute declares the browser history list the number of elements.
Note: Internet Explorer and Opera starting at 0, while Firefox, Chrome and Safari starts at 1.
grammar
history.length
Browser Support
All major browsers support length property
Examples
Examples
Returns the number of URL in the history list:
<script>
document.write("历史列表中URL的数量: " + history.length);
</script>
document.write("历史列表中URL的数量: " + history.length);
</script>
Examples of the above output:
try it"
History Object