/

HTML / CSS / JavaScript Tutorial

JavaScript History property: length

[this page | pdf | back links]

The length property (of the JavaScript BOM history object) returns the number of URLs in the history list.

 

EXAMPLE:


HTML USED IN THIS EXAMPLE:
<!DOCTYPE html>
<html> <!-- Copyright (c) Nematrian Limited 2018 -->
<head>
<style>
table,td,tr,th,caption {border: thin solid black; border-collapse: collapse;}
</style>
</head>
<body>
<table >
  <tr><th>history property</th><th>Value returned</th></tr>
  <tr><td>length</td><td id="x1"></td></tr>
</table>

<script id="element">
document.getElementById("x1").innerHTML = history.length;
</script>

</body>
</html>


NAVIGATION LINKS
Contents | Prev | Next | JavaScript DOM (and BOM)


Desktop view | Switch to Mobile