TextNode Object

DHTML, HTML, & CSS

TextNode Object


Represents a string of text as a node in the document hierarchy.

Remarks

Use the createTextNode method to create a TextNode object. Once you create the TextNode, you can add to it using the appendChild, replaceNode, or insertBefore methods.

This object is available in script as of Microsoft® Internet Explorer 5.

Members

Example

This example uses the TextNode object to change the text of an LI object.

<SCRIPT>
function fnChangeText(){
   var oTextNode = document.createTextNode("New List Item 1");
   var oReplaceNode = oItem1.firstChild.replaceNode(oTextNode);
}
</SCRIPT>

<UL onclick = "fnChangeText()">
<LI ID = oItem1>List Item 1
</UL>


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.