This is for those who want to stop the uninvited guest, doing unwanted things on your site. The below code will helps you to protect your website’s content from being copied by totally disabling the right click on your website.
JAVASCRIPT
Copy paste this code in HEAD tag
1 2 3 4 5 6 7 8 9 10 11 12 13 | function killCopy(e){ return false } function reEnable(){ return true } document.onselectstart=new Function ("return false") if (window.sidebar){ document.onmousedown=killCopy document.onclick=reEnable } |
HTML
Add this code in the BODY Tag.
1 | ondragstart="return false" onselectstart="return false" oncontextmenu="return false" |
Code tested successfully!