.append link will not fire onclick function
<p>I've searched around I cannot find the answer to this. In my code, a link is created inside of a div and given an onclick value to pass an argument to a function. I cannot figure out why it will not fire.</p>

<pre><code>var imgCount = 0;
var curImg;


function resetImg(target) {
alert(target);
}



$(".add").click(function () {
imgCount = imgCount + 1;
curImg = "theImg" + imgCount;


//Here we add the remove link
$('#links')
    .append('&lt;a href="#" onclick="javascript:resetImg(\'' + curImg + '\');"  class="dynamic"&gt;Call Function&lt;/a&gt;');
$('.dynamic').css('display', 'block');
});
</code></pre>

<p>Here's the fiddle:
<a href="http://jsfiddle.net/stewarjs/4UV7A/" rel="nofollow">http://jsfiddle.net/stewarjs/4UV7A/</a></p>

<p>I've tried using .click() when creating the link, but the argument being passed needs to be unique to each link. I've tried grabbing $(this).attr("id") but the value comes back undefined.</p>

<p>Thanks for any and all help.
Jeff</p>
