title: jQuery e.target bubbling best practice?
body: <p>In my heavy-ajax code, i always bind "click" the body tag &amp; act depending on <code>$(e.target)</code> &amp; using <code>$.fn.hasClass()</code>. However when i click on an anchor that has a <code>&lt;/span&gt;</code> tag inside, my <code>$(e.target)</code> equals this node, and not the parent anchor as i would like it to.</p>
  
  <p>From now on, i have used this trick (<code>var $t = $(e.target);</code>) :</p>
  
  <pre><code>/** bubbling **/
  if($t.get(0).tagName !== "A" &amp;&amp; $t.get(0).tagName !== "AREA") {
      $t = $t.parent("a");
     if(empty($t)) return true;
     //else console.log("$t.bubble()", $t);
  }
  </code></pre>
  
  <p>It feels wrong somehow... Do you have any better implementation ?</p>
  
  <hr>
  
  <p><code>$.fn.live()</code> does not solve my issue as it still returns the span as the target. Moreover i'm looking for speed (running on atom-based touch devices) &amp; live appeared to be way slower (twice) : <a href="http://jsperf.com/bind-vs-click/3" rel="nofollow">http://jsperf.com/bind-vs-click/3</a></p>
  
  <hr>
  
  <p>In fact, as @Guffa pointed, using <code>$.fn.live()</code> solves the span bubbling issue as i don't need the <code>event.target</code> anymore. I guess there is no other "right" answer here (using bind on a container).</p>