/**自定义右击菜单,阻止默认右击菜单**/
var btn = document.getElementById('btn');
btn.oncontextmenu=function(event) {
//-- do something here
alert("ContextMenu Popup");
//-- prevent the default behavior
if (document.all)
window.event.returnValue = false;// for IE
else
event.preventDefault();
}
网友评论