HTML DOM normalizeDocument() Method (original) (raw)

Last Updated : 11 Jul, 2025

The normalizeDocument() method in HTML is used to normalize an HTML document by remove any empty text nodes if exists. After removing the empty nodes, it also merges all of the adjacent nodes present in the document.For Example, consider the below element:

Element Geeks Text node: "" Text node: "Hello " Text node: "wor" Text node: "ld"

The above element after normalization will become "Hello world".**Note:**This method is not supported by any browser, but it works as DOM normalize() Method and Display the output.Syntax:

geeknode.normalize()

Parameters:

Example:

html `

GeeksForGeeks | HTML DOM Normalize Method