Click to return to the DHTML, HTML     
TEXTAREA Element | TEXTAR...     TextRange Object     DHTML Objects    
Web Workshop  |  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!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.