asp.net.ph

Skip Navigation Links

parentTextEdit Property

DHTML Object Properties   DHTML Objects


Retrieves the next object in the hierarchy that can be used to create a text range that contains the original object.

Syntax


HTML N/A
Script [ oObject = ] object.parentTextEdit

Possible Values


oObject Next object in the hierarchy.

The property is read-only with no default value.

Remarks

The property is an object if the parent exists; otherwise, it is null.

Example

The following example retrieves the parent object ( if needed ), creates the text range, moves to the original object, and selects the first word in the object.

<script language="JScript">
function selectWord ( )
{
  var oSource = window.event.srcElement ;
  if ( !oSource.isTextEdit ) oSource = 
    window.event.srcElement.parentTextEdit;
  if ( oSource != null ) {
    var oTextRange = oSource.createTextRange ( );
    oTextRange.moveToElementText ( window.event.srcElement );
    oTextRange.collapse ( );
    oTextRange.expand ( "word" );
    oTextRange.select ( );
  }
}
</script>


>

© 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