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 a TextNode object.
Example
This example uses the createTextNode method to create a text node and replace it with an existing text node in a SPAN object.
<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>
Applies To
[ Object Name ] Platform Version Win16: Win32: Mac: Unix: WinCE: Version data is listed when the mouse hovers over a link, or the link has focus. document
See Also
Did you find this topic useful? Suggestions for other topics? write us!
© 1999 microsoft corporation. all rights reserved. terms of use
.




Back to top