Skip to content

Tag: children

Loop through childNodes

I’m trying to loop through childNodes like this: However, it output Uncaught TypeError: undefined is not a function due to forEach function. I also try to use children instead of childNodes but nothing changed. Does anybody know what’s going on? Answer The variable children is a NodeList instance …