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
You could also use prototyping
NodeList.prototype.addEventListener = function (type, callback) { this.forEach(function (node) { node.addEventListener(type, callback); }); };