NEWSubscribe to Receive Free E-mail UpdatesSubscribe

How To Disable Mouse Selection On Blogger And WordPress

For Protecting you blog from copyright this is the easiest way is to disable mouse selection on your blog, after this no one can copy text and images, we can make it possible by using small JavaScript code which will disable mouse selection on blog.

JavaScript Code For Disabling Mouse Selection

<script type="text/javascript">
var omitformtags=["input", "textarea", "select"]
omitformtags=omitformtags.join("|")
function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false }
function reEnable(){
return true }
if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else {
document.onmousedown=disableselect
document.onmouseup=reEnable }
</script>

How to use for Blogger
  • Go to blogger dashboard
  • Click on Template tab.
  • Now Add Gadget >> HTML/JavaScript
  • Paste JavaScript code above.
  • Click on Save button.

How to use for WordPress
  • Go to Wordpress dashboard
  • Now click on Appearance >> Widgets >> Add New Text Widget
  • Paste JavaScript code above.
  • Click on Save button.
This trick is working on all major browser which support JavaScript.