I wrote this piece of code several years ago, and at the time, it works in Firefox and Chrome, but now, it results in an infinite loop in Chrome:

```
<script>
    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();
}
</script>

<div onclick="clickChildLink(this, event);">  
    <a href="#" onclick="console.log('before'); event.stopPropagation(); console.log('after'); return false;">Header</a>
</div>  

```

You can run the code here: <http://jsfiddle.net/Py7Mu/205/>

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.

I know I should be using less obtrusive JavaScript, but this stems from an old rails app (upgrade will hopefully come soon enough).

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.