Language References
DOM Level 1 Specification.
Represents a string of text as a node in the document hierarchy.
Use the createTextNode method to create a TextNode object. Once created, the TextNode can be added to the document using the appendChild, replaceNode, or insertBefore methods.
TextNode Members
The following sample demonstrates the use of the TextNode object to change the text of a LI object.
<script language="JavaScript">
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>