<html>
<body>
<h1>The Document Object</h1>
<h2>The getElementsByTagName() Method</h2>
<p>An unordered list:</p>
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
<p>The number of li elements in this document is:</p>
<p id="demo"></p>
<script>
const collection = document.getElementsByTagName("li");
document.getElementById("demo").innerHTML = collection.length;
</script>
</body>
</html>