Disabling Text Selection in web page - Stop highlight

by Selva 2008-08-29 19:23:51

I have faced a text selection issue, when i enable click and drag in a web page. When i dragged an element the text in web page are selected.This issue is solved by adding a CSS property -moz-user-select: none . This property works in FireFox only. The text selection issue in IE can be solved by adding a event called onselectstart

Example : To disable text selection for a div element

This is test. try selecting this line.....

it wont be highlighted while you select it..


Code :

<div onselectstart="return false;" style="-moz-user-select: none;">


Create Your Own Website / Host Your Website @ HIOXINDIA

Tagged in:

6658
like
1
dislike
0
mail
flag

You must LOGIN to add comments