I'm trying to shim Element.prototype.children which should return a HTMLCollection
Element.prototype.children
(我正在尝试对应该返回HTMLCollection的 Element.prototype.children进行填充)
There is a window.HTMLCollection
window.HTMLCollection
(有一个window.HTMLCollection)
However
(然而)
var h = new HTMLCollection(); //TypeErrror: HTMLCollection is not a constructor
and
(和)
var h = Object.create(HTMLCollection.prototype); h[0] = div; h.item(0); // Could not convert JavaScript argument
Test Firefox 7 and Chrome
(测试Firefox 7和Chrome)
Apart from shimming HTMLCollection is there any way to interact with it?
HTMLCollection
(除了HTMLCollection之外,还可以与它进行交互吗?)
Also provide feedback on this github issue if you can suggest a solution
(如果您可以提出解决方案,还请提供有关此github问题的反馈)
2.1m questions
2.1m answers
60 comments
56.8k users