I saw an example to use .is(":focus")
to check if another object is in focus, but it's not working as expected. I'm using FireFox, and expect it to work in all browsers supporting jQuery.
Html:
<input class=a value=a>
<input class=b value=b>
^ focus on the input a
How to make input.b stay visible when focus moves off .a and to .b?
Js:
$(".a").focus(function(){
$(".b").show();
});
$(".a,.b").blur(function(){
var f = false;
if($(".a").is(":focus")) var f = true;
if($(".b").is(":focus")) var f = true;
if(!f) $(".b").hide();
});
Input.b always hides when i move focus to it, but it shouldn't.
Here's a fiddle, http://jsfiddle.net/7gXfC/1/
I don't see how else to do this