Correct. The only way to reliably find out what element current has
focus is to bind a "focus" handler to all the elements that might take
focus on the page. When an element gets focus, you note it down. For
example:

var currentFocus = null;
$(':input').focus( function() {
    currentFocus = this;
}).blur( function() {
    currentFocus = null;
});

Karl Rudd

On Tue, Jul 22, 2008 at 10:12 PM, Joel Newkirk <[EMAIL PROTECTED]> wrote:
> I don't think that'll work out as you expect...  $(selector).focus() GIVES
> $(selector) the focus, it doesn't test whether it already HAS focus.
> Ideally there would be a selector such as :focus, fitting in with :enabled,
> :selected, :hidden, and others.
>
> j
>
> On Mon, Jul 21, 2008 at 5:27 PM, jquertil <[EMAIL PROTECTED]> wrote:
>>
>> you should be able to return the focus() event.
>>
>> if( $('#navTable').focus() == true )
>>
>> might need to play with the selector to get it right.
>
>

Reply via email to