views:

93

answers:

2

I'm using a DIV as a simple DHTML graphical button on a webpage. It contains no text, and a background image provides the button's appearance. This works perfectly in Firefox and Chrome, but in IE, when the button is clicked a blinking vertical text cursor shows up, presumably where the text line would start. How do I disable this?

I've tried the normal JS and CSS tricks, like binding onstartselect to "function(){ return false; }" and setting "cursor: none;" and "user-select:none;" (which probably isn't supported in IE), but these had no effect. Is there anything else I can do?

EDIT: Yes, by "text cursor" I mean "Caret", or the cursor that indicates the insertion point for your text. For me, if I open ANY page in IE7 and single-click on some text, the caret appears at the position I clicked.

A: 

If It is a button, for better UI you should set style="cursor:pointer;" to let the user know that's an click area...

Never the less, a cursor must be present in all times, the browser will always render it, whether you specify it or not..

Zuul
I think he is referring to that little blinking line that appears whenever you click a textbox, and it's appearing for him when he clicks the div.
Marcin
@Marcin, I've took another "read" to the question...your right! Need to think a little to rephrase my answer ;)
Zuul
A: 

This is caused by a browser mode called Caret Browsing and can be toggled on/off by pressing F7.

Chris S