Click to return to the DHTML, HTML     
length Property     letter-spacing Attribute ...     DHTML Properties    
Web Workshop  |  DHTML, HTML & CSS

length Property


Retrieves the number of characters in a TextNode object.

Syntax

HTML N/A
Scripting[ iLength = ] object.length

Possible Values

iLengthInteger that specifies the number of characters.

The property is read-only with no default value.

Example

This example uses the length property to specify where a TextNode is split using the splitText method.

<SCRIPT>
function fnChangeValue(){
   var oListItem = document.createElement("LI");
   oList.appendChild(oListItem);
   var oNode = oList.firstChild.childNodes(0);
   var oTextNode = oList.firstChild.childNodes(0);
   var oSplit = oTextNode.splitText(oTextNode.length/2);
   oListItem.appendChild(oSplit);

}
</SCRIPT>

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

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
TextNode


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.