Name

Node.normalize( ): merge adjacent Text nodes and remove empty ones — DOM Level 1 Core

Synopsis

void normalize( );

Description

This method traverses all descendants of this node and “normalizes” the document by removing any empty Text nodes and merging all adjacent Text nodes into a single node. This can simplify the tree structure after node insertions or deletions.

See Also

Text

Get JavaScript: The Definitive Guide, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.