srcElement Property
Sets or retrieves the object that fired the event. SyntaxHTML N/A 
Scripting event.srcElement [ = oObject ] Possible ValuesoObject Object that specifies or receives the event that fired. The property is read/write. The property has no default value.Expressions can be used in place of the preceding value(s), as of Microsoft? Internet Explorer 5. For more information, see Dynamic Properties.ResThe property is read-only in Microsoft? Internet Explorer 4.0, and read/write in Internet Explorer 5 and later.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.
<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>

解决方案 »

  1.   

    只有一种用法,获得对象
    obj=window.event.srcElement可以用:obj.tagName 来获得对象的标签名称
      

  2.   

    当把把Body设置成 TextRange 对象了,还可以通过 srcElement 的 parentElement 获得当前事件源的父对象oElement = TextRange.parentElement()有关 srcElement 的帮助:
    http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/srcelement.asp?frame=true