data property
[This documentation is preliminary and is subject to change.]
Sets or gets the value of a TextNode object.
Syntax
| JavaScript | |
|---|
Property values
Type: String
the value of the TextNode.
Standards information
- Document Object Model (DOM) Level 1 Specification, Section 1.2
Examples
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>
Build date: 3/8/2012