JavaScript-右键菜单禁止/解除

JavaScript鼠标右键禁止/解除

使用oncontextmenu返回false禁止,返回true解除

document.oncontextmenu=function(e){
            return false;//禁止右键
}