create a HTMLCollection

后端 未结 4 1420
半阙折子戏
半阙折子戏 2020-12-01 23:39

I\'m trying to shim Element.prototype.children which should return a HTMLCollection

There is a window.HTMLCollection

However

var h = new HTML         


        
4条回答
  •  离开以前
    2020-12-02 00:18

    Don't expect host objects to behave like (ECMAScript) native objects, they are completely different things. Some browsers do implement their DOM objects like ECMAScript objects, but it is not required and should not be relied upon. Note that most HTML collections are live, it is very difficult to emulate that in a native object.

提交回复
热议问题