DHTML Object Properties DHTML Objects
Sets or retrieves the TextNode object data.
HTML |
N/A |
Script |
[ sData = ] object.data |
sData |
Value of the TextNode. |
The property is read/write with no default value.
The following sample demonstrates the use of the data object property to dynamically set the value of a text node.
<script language="JavaScript">
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>
<li>Start Here
</ul>
TextNode