Click to return to the DHTML, HTML     
SRC Attribute | src Prope...     srcFilter Property     DHTML Properties    
Web Workshop  |  DHTML, HTML & CSS

srcElement Property


Retrieves the object that fired the event.

Syntax

HTMLN/A
Scripting[ oObject = ] event.srcElement

Possible Values

oObjectObject that specifies the event that fired.

The property is read-only with no default value.

Example

This example uses the srcElement property to retrieve the parent object, if needed, create the text range, move to the original object, and select the first word in the object.

Sample Code

<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>

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
HTML N/A
Scripting event


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.