Tuesday, October 9, 2007

Disable right click on web page

Hi Friends,

Here is the small JavaScript function to disable right click.

//register right click event (mouse click)

document.onmousedown = disableclick;
//function

function disableclick(e)
{

if(event.button==2)
{
alert("Right Click Disabled");
return false;
}
}

thanks,

vijju

No comments: