Disable Mouse Right Click HTML using JAVASCRIPT

Опубликовано: 29 Сентябрь 2024
на канале: Ramzi Fayad
579
3

#disable_Mouse_Click
#Disable_Click_HTML

Email Address
[email protected]

disable mouse click in HTML using javascript

THE CODE BELOW MUST BE INSERTED WITHIN SCRIPT (ANGLED BRACKETS)
var isNS = (navigator.appName == "Netscape") ? 1 : 0;
if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);
function mischandler(){
return false;
}

function mousehandler(e){
var myevent = (isNS) ? e : event;
var eventbutton = (isNS) ? myevent.which : myevent.button;
if((eventbutton==2)||(eventbutton==3)) return false;
}
document.oncontextmenu = mischandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;