不行,attachEvent事件并不记入object属性.
此时object.sEvent仍为null,无法检测到.故无法通过object对象体系检测到是否有event被attach体会如下代码:
=================================
<body>
<button id=btn>hello</button> <HR>
<SCRIPT LANGUAGE="JavaScript">
btn.attachEvent("onclick", new Function("alert(event.srcElement.tagName)"));if (btn.onclick)
{
alert('attach onclick')
}else
{
         alert('onclick is null')
}
</SCRIPT>
</body>
=================================
<button id=btn onclick="alert(event.srcElement.tagName)">hello</button> <HR>
<SCRIPT LANGUAGE="JavaScript">
if (btn.onclick)
{
alert('attach onclick')
}else
{
         alert('onclick is null')
}
</SCRIPT>
</body>