Summary: | Node.childNodes returns a new NodeList each time | ||
---|---|---|---|
Product: | WebKit | Reporter: | boucher <rboucher> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | abarth, ap, kling, pf, sam |
Priority: | P2 | ||
Version: | 523.x (Safari 3) | ||
Hardware: | Mac | ||
OS: | OS X 10.5 |
Description
boucher
2008-02-05 12:52:47 PST
Apparently the actual problem here is that every time you call element.childNodes, you get a new NodeList. So, the following will not work: element.childNodes.foo = 1; alert(element.childNodes.foo); //undefined But, this does work: var e = element.childNodes; e.foo = 1; alert(e.foo); Obviously the severity of this is significantly less now, since the alternate method is acceptable. Though it would be ideal if two immediate requests to element.childNodes returned the same list. |