Tuesday, August 21, 2007

Prevent unwanted text selection and unwanted drag and drop

Some days back, I was facing a strange problem. When my web page is in the loading stage I was able to drag the images on the page to adress bar and any other location in the page. I ’ve never seen this before, and I spend some time to conclude the problem and then I came up with very a nice solution to prevent unwanted text selection and unwanted drag and drop in IE, So I have added the below mentioned event defination in the body tag of HTML.

<body onselectstart='return false;' ondrag='return false;'>

No comments: