Document.height

已废弃
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

 

Note: 在Gecko的6.0版本之后, document.height 不再被支持。 使用 document.body.clientHeight来代替. 详见 element.clientHeight.

返回 document 对象的高度. 在大多数场景中, 它相当于当前文档的 <body> 元素。

语法

pixels = document.height

示例

// alert document height
alert(document.height);

可选操作

document.body.clientHeight
document.documentElement.clientHeight
document.documentElement.scrollHeight

规范

HTML5

兼容性

BCD tables only load in the browser

另请参阅