srcElement Property--------------------------------------------------------------------------------Retrieves the object that fired the event. SyntaxHTML N/A
Scripting [ oObject = ] event.srcElement Possible ValuesoObject Object that specifies the event that fired. The property is read-only with no default value.ExampleThis 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 ]
Platform Version
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
HTML N/A
Scripting event
Move the mouse cursor over an element in the Applies To List to display availability information for the listed platforms.
Scripting [ oObject = ] event.srcElement Possible ValuesoObject Object that specifies the event that fired. The property is read-only with no default value.ExampleThis 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 ]
Platform Version
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
HTML N/A
Scripting event
Move the mouse cursor over an element in the Applies To List to display availability information for the listed platforms.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货