Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Retrieves the object that fired the event.
Syntax
HTML N/A Scripting [ 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.
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
HTML N/A Scripting event
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.