DEV Community

Discussion on: How to build an Accordion Menu using HTML, CSS and JavaScript

Collapse
 
tohka200213 profile image
tohka20-0213

In JS part, why did you get elements as HTMLCollection by using getElementsByClassName method?

In this case, I get a NodeList instead and use a forEach method. Because the code becomes simpler.