<html> <head> <script type="text/javascript"> function BtnPress(event) { var btnNum = event.button; if (btnNum==2) { alert("您点击了鼠标右键!") } else if(btnNum==1) { alert("您点击了鼠标左键!") } else if(btnNum==4) { alert("您点击了鼠标中键!"); } else { alert("您点击了" + btnNum+ "号键!"); } } </script> </head> <body onmousedown="BtnPress(event)"> <p>请在这里随便点一下鼠标键</p> </body> </html>
时间: 2024-10-06 04:55:59