Sets or retrieves the object that fired the event. For the standards based property see srcElement.
Syntax
| JavaScript | |
|---|
Property values
Type: Object
the event that fired.
Remarks
The property is read-only in Microsoft Internet Explorer 4.0, and read/write in Microsoft Internet Explorer 5 and later.
Examples
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.
<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>
See also
Send comments about this topic to Microsoft
Build date: 1/23/2013