title: Javascript/jQuery: Why is the focus event not firing on an input field?
body: <p>I'm trying to attach a simple focus/blur event listener via the <code>.live()</code> jQuery method to my inputs but what I'm noticing is that the <code>focus</code> event is not firing whereas the <code>blur</code> event is.</p>
  
  <p>Strange… was hoping you may have an idea of why this is happening.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>function rowHighlight() {
    var form = $('form.register'),
        ele = {};
  
        form.find('label').each(function(i) {
          var link = this.htmlFor;
          form.find('label[for='+link+'],input[name='+link+'],textarea[name='+link+']').wrapAll('&lt;span class="row"/&gt;');
        });
  
        ele.row = $('form &gt; .row');
        ele.inputs = ele.row.find('input');
  
  
        $.each(ele.inputs, function(i) {
            $(this).focus(function() {
                console.log('hello'); // this will fire.
            });
          $(this).live('focus blur', function(e) {
              console.log('current event type: '+e.type); // the focus on this will not fire!?
              ( e.type=='focus' ? console.log('focussed') : console.log('blurred') )
          });
        });    
  }
  rowHighlight();
  </code></pre>
  
  <p><code>$(this).focus…</code> was just put it as a debugging thing and removing it does not make the <code>focus</code> on the <code>live</code> listener work…</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks for stopping by.</p>
  
  <p>Jannis</p>