Skip to content Skip to sidebar Skip to footer

Text Unselectable In Ie

I require one HTML element (Label) on my page to be unselectable for IE ... currently I have tried Unselectable=on onselectreturn=false; none of which is helping me out. For Fire

Solution 1:

<label unselectable="on"> should work for IE in the HTML. If applying it from javascript you MUST use setAttribute: labelEl.setAttribute("unselectable","on"). labelEl.unselectable = "on" does not work (tested in IE9).

Note that the "unselectable" attribute only affects text directly inside the element, not within its children - you need to set unselectable on them also, if that's the effect you want.

Solution 2:

Set unselectable to off and it should work.

<labelunselectable="off">Something</label>

http://jsfiddle.net/sWguE/1/

This also works for me

<labelonselect="return false">Something</label>

http://jsfiddle.net/sWguE/3/

Post a Comment for "Text Unselectable In Ie"