<html>
<body>
<h1>The HTMLCollection Object</h1>
<p>Loop through each HTML element on this page, and write its tag name:</p>
<script>
var x, i, l;
x = document.getElementsByTagName("*");
l = x.length;
for (i = 0; i < l; i++) {
document.write(x[i].tagName + "<br>");
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_htmlcollection_loop by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 05 Jun 2019 14:05:37 GMT -->
</html>