Does NodeList support addEventListener. If not what is the best way to add EventListener to all the nodes of the NodeList. Currently I am using the code snippet as show be
There actually is a way to do this without a loop:
[].forEach.call(nodeList,function(e){e.addEventListener('click',callback,false)})
And this way is used in one of my one-liner helper libraries - nanoQuery.