HTML页面右键事件
<script type="text/javascript">
<!--
document.onmousedown = function (e) {
var e = e || window.event
alert("e" + e.button);
if (e.button == "2") {
alert("执行右键代码");
}
}
//-->
function right() {
var e = window.event;
alert(e.button);
if (e.button == "0") {
alert("左键");
} else {
alert("右键");
}
}
</script>