鼠标左右键测试

<html>
<head>
<title>鼠标左右键测试</title>
<!--HarryPotter-->

<script language="javascript">
function Mytest()
{
if (event.button == 1)
alert("你好");
else
{
alert("禁止右键!");
setTimeout("CloseWiondows();",30000)
}
}

function CloseWiondows()
{
window.close();
}
</script>

</head>

<body onmouseup="Mytest();">
点击鼠标左键弹出"你好"</p>
点击右键弹出禁止右键</p>
30秒后关闭窗口</p>
</body>
</html>