title: Trouble with event.stopPropagation() & onClick (jQuery)
body: <p>I wrote this piece of code several years ago, and at the time, it works in FF &amp; Chrome, but now, it results in an infinite loop in Chrome.</p>
  
  <pre><code>&lt;script&gt;
      function clickChildLink(el, event) {
          console.log('inside function');
          var evtTarget = $(event.target);
          if (evtTarget.is('a')) {
              console.log('returning');
              return; //ignore clicks if its a link
          }
          $(el).children('a').click();
  }
  &lt;/script&gt;
  
  &lt;div onclick="clickChildLink(this, event);"&gt;  
      &lt;a href="#" onclick="console.log('before'); event.stopPropagation(); console.log('after'); return false;"&gt;Header&lt;/a&gt;
  &lt;/div&gt;  
  </code></pre>
  
  <p>You can run the code here: <a href="http://jsfiddle.net/Py7Mu/205/" rel="nofollow">http://jsfiddle.net/Py7Mu/205/</a></p>
  
  <p>Basically, what its supposed to do, is if the user clicks inside the div (i.e. Header), it finds the link within it, and invokes a click on it. On Chrome, that invoked click also propagates back to the parent, which in turn starts the whole process again.</p>
  
  <p>I know I should be using less obtrusive javascript, but this stems from an old rails app (upgrade will hopefully come soon enough).</p>
  
  <p>Any idea why the event doesn't actually stop propagating? Technically, the code should work without the stopPropagation call, as the if statement inside the function should stop subsequent calls from firing. Apparently, Chrome does not update the currentTarget when programmatically invoking a click</p>