TUTORIALFrontendFETCHED

HTML DOM normalizeDocument() 方法

HTML DOM normalizeDocument() 方法 Document 对象 实例 规范一个实体文档: document.normalizeDocument(); 定义和用法 normalizeDocument() 方法可以移除空文本节点 , 并合并相邻节点。 目前没有主流浏览器支持 normalizeDocument() 方法, 但是可以使用类似的方法 normalize() 方法。 浏览器支持 目前..

Updated 7/16/2026

Tutorial detail pages default to noindex.

HTML DOM normalizeDocument() 方法

Document 对象参考手册 Document 对象

实例

规范一个实体文档:

document.normalizeDocument();

定义和用法

normalizeDocument() 方法可以移除空文本节点 , 并合并相邻节点。

目前没有主流浏览器支持 normalizeDocument() 方法, 但是可以使用类似的方法 normalize() 方法。


浏览器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

目前没有主流浏览器支持 normalizeDocument() 方法


语法

document.normalizeDocument()

参数

None.

返回值

没有返回值。

技术细节

DOM 版本 Core Level 3


Document 对象参考手册 Document 对象