XML DOM createTextNode() Method

The following code fragment loads "books.xml" into xmlDoc and adds an element node with a containing text node to each <book> element

Definition and Usage

The createTextNode() method creates a text node.

This method returns a Text object.

Syntax

createTextNode(text)
Parameter Description
text A string that specifies the text for the node

❮ Document Object