★ wanayoo — archive 1999 http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/TextNode.aspNouvelle recherche | Portail wanayoo
MSDN Online Web Workshop   All Products  |   Support  |   Search  |   microsoft.com Home  
microsoft.com Home
  Home  |   Magazines  |   Libraries  |   Developer Centers  |   Resources  |   Downloads  |   Search MSDN
 
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>