aspxtreme

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



Books and more ...

Contents
HTML Elements / DOM Objects
HTML Element Attributes
CSS Attributes
DOM Object Properties
DOM-compliant Events Reference
DOM Methods Reference
DOM Collections Reference
 


Suggested Reading



Previous page Back to top Next page

Check out related books at Amazon

© 2000-2008 Rey Nuñez All rights reserved.

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

You can help support aspxtreme