![]() |
VOOZH | about |
The createTextNode() method is used to create a TextNode which contains an element node and a text node. It is used to provide text to an element. This method contains the text values as parameters which are of string type.
Syntax:
document.createTextNode( text )Parameters: This method accepts single parameter text which is mandatory. It is used to specify the text of the text node.
Example: In this example, we will use createTextNode() method
Output:
👁 ImageSupported Browsers: The browser supported by DOM createTextNode() Method are listed below: