event对象属性envet.button提示你点击了哪个鼠标按键
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript">
<!--
function whichButton(event)
{
if(event.button==2)
{
alert("您点了鼠标右键!");
}
else
{
alert("您点了鼠标左键!");
}
}
//-->
</script>
</head>
<body onmouseDown="whichButton(event)">
<p>请在网页任意一个地方点击,将提示您点了哪个鼠标按键!</p>
</body>
</html>