In JavaScript I want to create a NodeList of elements that are inside inside the…
- User
In JavaScript I want to create a NodeList of elements that are inside inside the children of the main element without using "mainElement.querySelectorAll". How can I do that?
- Assistant
You can collect all the elements inside the children of a main element by using a combination of the
.childrenproperty and the.getElementsByTagName('*')method. Here's how you can do it:javascript