HTML DOM Document createTextNode()
HTML DOM Document createTextNode() Method
The createTextNode() method is used for creating a text node. All HTML elements, attributes, and texts are basically nodes. Some nodes are in parent-child relations and some others contain attributes or text nodes or both.
Syntax:-
Its syntax is:- document.createTextNode(text)
Return:-
Its return is:- created text node
Further Explanation:-
Parameter | Description |
text | Required. The text for the node. |