<div>First div</div>
<script>
let divs = document.getElementsByTagName('div');
alert(divs.length); // 1
</script>
<div>Second div</div>
<script>
alert(divs.length); // 2
</script>
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.