jQuery incrementation param passing weird behavior
<p>Let me describe my scenario before I say my question:</p>

<p>Let counter be defined already as a number starting from 0.</p>

<p>I have 2 a tags: let them be a1 and a2</p>

<p>I first dynamically added a1 into my html and then used this:</p>

<pre><code>jQuery("a.adder").click(function(){adder(this, counter)});
</code></pre>

<p>then I did <code>counter++</code></p>

<p>then I dynamically added a2 into my html and then used this again on <strong>both</strong> my a tags</p>

<pre><code>jQuery("a.adder").click(function(){adder(this, counter)});
</code></pre>

<p>then I did <code>counter++</code></p>

<p>also, in my <code>adder(param1, param2)</code> , all I do is <code>alert(counter)</code></p>

<p>Okay here's my question: After doing all that, when I clicked on a1 which has 2 handlers, the alert output is 2 (it alerts twice for each handler) and for a2, the alert is also 2  when clicked. Why is this happening?</p>
