Matching anonymous functions to the event behind the scenes?
<p>When I do </p>

<pre><code>&lt;a onclick='foo()'&gt;&lt;/a&gt;
</code></pre>

<p>According to firebug - it creates anonymous function</p>

<p>like this : </p>

<pre><code>function onclick(event) { foo(); } 
</code></pre>

<p>But <strong>how does he knows</strong> how to attach those both to each other ?</p>

<p>( maybe the click came from <code>DIV</code> and not from this <code>A</code> )</p>

<p>I'm missing this point...</p>

<p>Can I please  have some Explanation ?</p>
