The length
property returns the number of URLs in the history list.
length |
Yes | Yes | Yes | Yes | Yes |
var v = history.length
A Number type value representing the number of URLs in the history.
The following code shows how to get the number of URLs in the history list.
<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script>
var x = history.length;
document.getElementById("demo").innerHTML = x;
</script><!-- ww w . ja v a 2s. c om-->
</body>
</html>
The code above is rendered as follows: