title: Using jQuery to test if an input has focus
body: <p>On the front page of a site I am building, several <code>&lt;div&gt;</code>s use the CSS <code>:hover</code> pseudo-class to add a border when the mouse is over them. One of the <code>&lt;div&gt;</code>s contains a <code>&lt;form&gt;</code> which, using jQuery, will keep the border if an input within it has focus. This works perfectly except that IE6 does not support <code>:hover</code> on any elements other than <code>&lt;a&gt;</code>s. So, for this browser only we are using jQuery to mimic CSS <code>:hover</code> using the <code>$(#element).hover()</code> method. The only problem is, now that jQuery handles both the form <code>focus()</code> <em>and</em> <code>hover()</code>, when an input has focus then the user moves the mouse in and out, the border goes away.</p>
  
  <p>I was thinking we could use some kind of conditional to stop this behavior. For instance, if we tested on mouse out if any of the inputs had focus, we could stop the border from going away. AFAIK, there is no <code>:focus</code> selector in jQuery, so I'm not sure how to make this happen. Any ideas?</p>