cancel
Showing results for 
Search instead for 
Did you mean: 

How to know element is focused or not?

mcasanket
Champ on-the-rise
Champ on-the-rise
HI All,
   In one requirement I need to know whether the element is focused or not. I am having the element Id. But when I use isFocused function it gives me JavaScript error.

   
alert("Focused: " +Dom.get(this.id + "-max").isFocused());

JavaScript error on console.
   Dom.get(this.id + "-max").isFocused is not a function


Please help me out!
Thanking you!
1 REPLY 1

mikeh
Star Contributor
Star Contributor
There's no such function as "isFocused" anywhere that I know of.

Take a look at the "focus" and "blur" events instead.

Thanks,
Mike