DEV Community

Discussion on: Everything about for loops in JavaScript?

Collapse
 
art4coding profile image
Ryan Tao Spencer

Can i use this to iterate over;
An array like object such as;
document.getElementsByClassName('something')[?];

to add an event listener to all nodes?
i tried [*] but it didn't do anything.

Collapse
 
harittweets profile image
Harit Himanshu

Could you please paste the code you have tried and what expected output you are looking for?