4 ms·
You can, the MDN article has an entire section on it: https://developer.mozilla.org/en-US/docs/DOM/NodeList https://developer.mozilla.org/en-US/docs/DOM/NodeLis
by MatthewPhillips 14y ago
You can, the MDN article has an entire section on it: https://developer.mozilla.org/en-US/docs/DOM/NodeList https://developer.mozilla.org/en-US/docs/DOM/NodeList
- nilliams 14y agoYes, except as that article shows the traditional for loop somehow ends up more palatable than the awkward `forEach.call()` voodoo you have to do to use it on a NodeList, which is a pretty sad state of affairs :/ (Note: I am aware you can alleviate this with toArray type utils [1] but that does seem to be slightly besides the point). [1] http://jsfiddle.net/AhQPU/ http://jsfiddle.net/AhQPU/