Vitaliy Borisok
Vitaliy Borisok

Reputation: 861

Blinking cursor in IE in textareas and inputs appears when blur() called

I'm trying to remove blinking cursor from inputs and textareas like this:

$('input, textarea').bind('click focus', function (e) {
    $this = $(this);
    if ($this.hasClass('disabled')) {
        e.preventDefault();
        $this.blur();
        return false;
    }
});

But if I click on a field in IE then blinking cursor appears for a moment and only then removed. Please, tell me how can I fix it without using 'disabled' attribute for elements? I use my own css class disabled (not attribute). Thx!

Upvotes: 0

Views: 365

Answers (1)

Adassko
Adassko

Reputation: 5343

have you tried binding to the "mousedown" event? And why you wouldn't just use the mentioned "disabled" ATTRIBUTE?

You can style it whatever you like in css using :disabled pseudo-class

Upvotes: 1

Related Questions