Skip to content

disable copy paste

July 16, 2008

<sourcecode lang=”javascript”>

if (typeof target.onselectstart!=”undefined”) //IE route
target.onselectstart=function(){return false}
else if (typeof!=”undefined”) //Firefox route”none”
else //All other route (ie: Opera)
target.onmousedown=function(){return false} = “default”


So basically two things.

IF IE  then set the onselectstart function returning false

if Mozilla / FF set the style MozUserSelect  as none

else for Opera set the mousedown to return false.

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: