I know how to do so with jQuery, and I know how to do so with event delegation. But how do you do so in plain JavaScript?
For example, how do you assign an event handler to a bunch of lis?
I see that var li = document.querySelectorAll('li');. Returns an array-like thing. Do you just loop through and assign handlers? I feel like there must be a better way. If not, what's the best way to loop through the array-like thing (and what is the array-like thing called?)?
li.<add listeners to each>. I'm still learning to program, but in hindsight what you said makes sense. Still, I think it's a completely understandable question for a student to have.