I\'m a big fan of using the forEach method on nodeLists like this:
var nodes = document.querySelectorAll(\".foo\"); [].forEach.call(nodes, function (item) {
I know it's an old post but using the forEach method can be done by stealing the Array prototype as well.
NodeList.prototype.forEach = Array.prototype.forEach;