Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can, the MDN article has an entire section on it: https://developer.mozilla.org/en-US/docs/DOM/NodeList


Yes, 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/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: