Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>The HTMLCollection Object</h1>
<h2>The length Property</h2>
<p>The number of paragraphs (p elements) are:</p>
<p id="demo"></p>
<script>
const elements = document.getElementsByTagName("p");
document.getElementById("demo").innerHTML = elements.length;
</script>
</body>
</html>