<div class="codetitle"> <span><a style="CURSOR: pointer" data="86019" class="copybut" id="copybut86019" onclick="doCopy('code86019')"><u>复制代码</u></a></span>代码如下:</div> <div class="codebody" id="code86019"> <br>var testButton=document.getElementById("testButton"); <br>function handlerTest() <br>{ <br>var oEvent=window.event;//对于 IE <br>//var oEvent=arguments[0];// 对于 DOM <br>if(oEvent.type ==“点击”) <br>{ <br>alert(“点击”); <br>} <br>else if(oEvent.type=="mouseover") <br>{ <br>alert("mouseover"); <br>} <br>其他 <br>{ <br>alert(oEvent.keycode); <br>} <br>} <br>testButton.onclick=handlerTest; <br>testButton.onmouseover=handlerTest; <br> </div> <br>html 元素如下:<input id="testButton" type="button" value="testButton" />