51help TIY
码:
<html> <head> <script type="text/javascript"> function whichButton(event) { var btnNum = event.button; if (btnNum==2) { alert("标右键!") } else if(btnNum==0) { alert("标左键!") } else if(btnNum==1) { alert("标中键!"); } else { alert("您点击了" + btnNum+ "名称。"); } } </script> </head> <body onmousedown="whichButton(event)"> <p></p> </body> </html>
查看结果: