首页 > 代码库 > 哪个鼠标被点击了?

哪个鼠标被点击了?

<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 onm ousedown="BtnPress(event)"><p>请在这里随便点一下鼠标键</p></body></html>

哪个鼠标被点击了?