Click to Rate and Give Feedback
Properties
 data Property
data Property

Sets or gets the value of a TextNode object.

Syntax

[ sData = ] TextNode.data

Possible Values

sDataString that specifies or receives the value of the TextNode.

The property is read/write. The property has no default value.

Example

This example uses the data property to change the value of a text node.

<SCRIPT>
function fnChangeValue(){
   var oNode = oList.firstChild.childNodes(0);
   var oNewText = document.createTextNode();
   oNewText.data="Create Data";
   oNode.replaceNode(oNewText);
   oNode.data = "New Node Value";
}
</SCRIPT>

<UL ID = oList onclick = "fnChangeValue()">
<LI>Start Here
</UL>

Standards Information

This property is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 World Wide Web link.

Applies To

TextNode
Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker