Keep focus on blur event

Posted by Jim on Stack Overflow See other posts from Stack Overflow or by Jim
Published on 2009-07-08T12:58:46Z Indexed on 2010/03/19 9:01 UTC
Read the original article Hit count: 523

Filed under:
|
|
|

I am using jquery to keep the focus on a text box when you click on a specific div. It works well in Internet Explorer but not in Firefox. Any suggestions?

var clickedDiv = false;

$('input').blur(function() { if (clickedDiv) { $('input').focus(); } });

$('div').mousedown(function() { clickedDiv = true; })
        .mouseup(function() { clickedDiv = false });

If you need anymore specifics let me know.

© Stack Overflow or respective owner

Related posts about blur

Related posts about jquery-events