<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>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_htmlcollection2 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:03:05 GMT -->
</html>