nodelist 不能使用foreach的解决办法

来源:互联网 发布:vb延时函数 编辑:程序博客网 时间:2024/06/13 11:21
if (window.NodeList && !NodeList.prototype.forEach) {        NodeList.prototype.forEach = function (callback, thisArg) {            thisArg = thisArg || window;            for (let i = 0; i < this.length; i++) {                callback.call(thisArg, this[i], i, this);            }        };    }
原创粉丝点击