You can add a class to your field when it has focus and then check for the class: $(":input") // add focus/blur events .focus(function (){ $(this).addClass("has-focus"); }) .blur(function (){ $(this).removeClass("has-focus"); });
Now you can just do $("input#1").is(".has-focus") to check if it has focus. -Dan On Mon, Aug 10, 2009 at 3:20 PM, MartinBorthiry <martin.borth...@gmail.com>wrote: > > Hello: > > I'm trying to know if an input has focus. Is that possible using > jquery? > > samething like this: > > $('input#1').has_focus() >