Created
September 4, 2020 09:45
-
-
Save sehrishnaz/70b1be3b1fbde520ce37518805a670f7 to your computer and use it in GitHub Desktop.
Disable Right Click and Text Selection in Blogger | WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
function disableselect(e){ | |
return false | |
} | |
function reEnable(){ | |
return true | |
} | |
//if IE4+ | |
document.onselectstart=new Function ("return false") | |
document.oncontextmenu=new Function ("return false") | |
//if NS6 | |
if (window.sidebar){ | |
document.onmousedown=disableselect | |
document.onclick=reEnable | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For details: https://learnopenerp.blogspot.com/2020/09/disable-right-click-text-selection-in-blogger-javascript.html