<div>hi<div>there</div>var el = document.getElementsByTagName("div"); document.write(el.length); | Sololearn: Learn to code for FREE!

0

<div>hi<div>there</div>var el = document.getElementsByTagName("div"); document.write(el.length);

What's the output and how?

4/24/2021 6:07:10 AM

Rohit Ahuja

1 Answer

New Answer

+4

Hello there! I made a small code where I explained a bit your code and how the output is. For any further explanation or if something isn't clear just let me know. :) https://code.sololearn.com/Wz08Vk1GK3Ec/?ref=app