asp.net.ph

Skip Navigation Links

srcElement Property

event Properties   DHTML Events


Retrieves the object that fired the event.

Syntax


HTML N/A
Script [ oObject = ] event.srcElement

Possible Values


oObject Object that fired the event.

The property is read-only with no default value.

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 tRange = oSource.createTextRange ( );
  tRange.moveToElementText ( window.event.srcElement );
  tRange.collapse ( );
  tRange.expand ( "word" );
  tRange.select ( );
}
}
</script>
Applies To

event



>

© 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