/

HTML / CSS / JavaScript Tutorial

JavaScript Document own method: createTextNode()

[this page | pdf | back links]

The createTextNode() method (when applied to the document object of the JavaScript DOM) creates a text node.

 

It has the following syntax with the following parameters. It returns an element object, representing the created element.

 

document.createTextNode(text)

 

Parameter

Required / Optional

Description

text

Required

String specifying the text in the text node

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript DOM (and BOM)


Desktop view | Switch to Mobile