Skip to content

ProtoString toTextNode() Method

Seth Clydesdale edited this page Jun 1, 2015 · 4 revisions

<< Back to DOM Node Methods

Example

Converting a text string into a text node, and appending it to the body.

document.body.appendChild('A simple text node !'.toTextNode());

Description

The toTextNode method converts a text string into a text node with document.createTextNode. This node can then be appended to any element in the HTML DOM.

Syntax

String.toTextNode();
Clone this wiki locally