<html>
<body>
<h1>The HTMLCollection Object</h1>
<p>Use the getElementsByTagName() method to return an HTMLCollection.</p>
<p>The number of P elements on this page:</p>
<script>
var x = document.getElementsByTagName("P");
document.write(x.length);
</script>
</body>
</html>