Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

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.

Gecko 6.0 note
(Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)

从Gecko 6.0开始,不再支持document.height属性. 请使用document.body.clientHeight来替代. 查看 element.clientHeight.

概述

返回当前文档中的<body>元素的高度.

语法

height_value = document.height

例子

// 弹出文档高度
alert(document.height);

用什么替代该属性

document.body.clientHeight
document.documentElement.clientHeight

相关链接

规范

DOM Level 0 不属于任何标准.

文档标签和贡献者

 此页面的贡献者: teoli, khalid32, ziyunfei
 最后编辑者: khalid32,