88888888888888888888888888 |
上面是效果,下面代码
<html> <script type="text/javascript"> <!-- document.onmousedown = function(e){ var e = e || window.event alert("e"+e.button); if(e.button == "2"){ alert("执行右键代码"); } } //--> function right() { var e=window.event; alert(e.button); if(e.button=="0"){ alert("左键"); }else{ alert("右键"); } } </script> <table border=1> <tr id=test name=test height=200 onmousedown="right()" ><td>88888888888888888888888888</td></tr> </table> </html>