Search DaTutorials:  
HOME
DHTML Reference
Introduction
Reference

createTextNode Method


Creates a text string from the specified value.

Syntax

oTextNode = document.createTextNode( [sText])

Parameters

sText Optional. String that specifies the nodeValue property of the text node.

Return Value

Returns the created TextNode object.

Example

<SCRIPT>
function fnChangeNode(){
   var oTextNode = document.createTextNode("New Text");
   var oReplaceNode = oSpan.childNodes(0);
   oReplaceNode.replaceNode(oTextNode);
}
</SCRIPT>

<SPAN ID="oSpan" onclick="fnChangeNode()">
Original Text
</SPAN>

Standards Information

method is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 Non-Microsoft link.

Applies To

document

See Also

createElement,>About the W3C Document Object Model

     Loans | Calorimeter Homogenizer Hot PLate | Credit Card Consolidation | Credit Cards | Mortgages
Home     Link To Us     Ad With Us     Contact Us     Tell A Friend     Affiliates     Blog     MsOfficeHelp