button:声明被按下的鼠标键,整数,1代表左键,2代表右键,4代表中键,如果按下多个键,就把这些值加起来,所以3就代表左右键同时按下;(firefox中 0代表左键,1代表中间键,2代表右键)
<html>
<head>
<script>
function click() {
if (event.button==2) {
alert('你想看什麽?')
}
if (event.button==1)
{
alert('你想看作践?');
}
}
document.onmousedown=click
</script>
</head>
<body>
禁止鼠标右键
</body>