Is there a way to find an input has focus

Is there a way to find an input has focus

I know I can put focus on a an element by $('#foo').focus(). 

However is it possible to find element $('#foo') has focus?