title: Is there a 'has focus' in JavaScript (or jQuery)?
body: <p>Is there something I can do like this (perhap via a plugin)</p>
  
  <pre><code>if ( ! $('form#contact input]').hasFocus()) {
    $('form#contact input:first]').focus();
  }
  </code></pre>
  
  <p>Basically, set focus to the first input, but only if the user has not already clicked into anything?</p>
  
  <p>I know this will work too, but is there anything more elegant?</p>
  
  <pre><code>$(function() {
    var focused = false;
    $('form#contact input]').focus(function() {
      focused = true;
    }); 
    setTimeout(function() {
      if ( ! focused) {      
        $('form#contact input:first]').focus();
      }
    }, 500);
  });
  </code></pre>