asp.net.ph

Skip Navigation Links

length Property

DHTML Object Properties   DHTML Objects


Returns the length of the data in a TextNode object.

Syntax


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

Possible Values


iLength Integer specifying the data length in a TextNode.

The property is read-only with no default value.

Example

The following sample demonstrates the use of the length object property to dynamically set where a TextNode is split using the splitText method.

<script language="JavaScript">
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>
  <li>Start Here
</ul>
Applies To

TextNode



>

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note