<html>
<body>
<h1>The Document Object</h1>
<h2>The getElementsByTagName() Method</h2>
<a name="html">HTML Tutorial</a><br>
<a name="css">CSS Tutorial</a><br>
<a name="xml">XML Tutorial</a><br>
<p>The number of anchors in this document is:</p>
<p id="demo"></p>
<script>
let num = document.getElementsByTagName("a").length;
document.getElementById("demo").innerHTML = num;
</script>
</body>
</html>