【发布时间】:2016-05-19 17:42:46
【问题描述】:
Visual Studio,提示document.body 是HTMLElement,而不是HTMLBodyElement,这是为什么呢? - 我没有任何运气来寻找答案。
class Test {
documentBody1: HTMLBodyElement;
documentBody2: HTMLElement;
constructor(){
this.documentBody1 = document.body; //wrong
this.documentBody2 = document.body; //right
}
}
【问题讨论】: