我正在尝试像这样循环遍历childNodes:
var children = element.childNodes;
children.forEach(function(item){
console.log(item);
});
Run Code Online (Sandbox Code Playgroud)
但是,它Uncaught TypeError: undefined is not a function由于forEach功能而输出.我也尝试使用children而不是childNodes改变.
有人知道发生了什么吗?