示例代码为什么不适用于DOM元素函数?
document.body.getAttribute.apply(this,['id']);
document.body.setAttribute.apply(this,['id','test']);
错误
火狐:
TypeError: 'setAttribute' called on an object that does not implement interface Element.
铬:
Uncaught TypeError: Illegal invocation
你从'的console.log得到什么(这个)',因为Firefox的错误信息清楚地表明, '这个'不是一个元素。 –