data

HTML (DHTML)

data Property

Internet Development Index

Sets or retrieves the value of a TextNode object.

Syntax

TextNode.data [ = sData ]

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 Non-Microsoft link.

Applies To

TextNode