Cannot passing dynamically created image's ID and alert it
<p>I am creating an image dynamically in Jquery and trying to add a control to it When the user clicks the image, I want to popup alert() with the image's id. But I couldnt succeed to show id of the image in the alert box. Please help me display the id of the image in alert box.</p>

<p>here is the code display the alert box</p>

<pre><code>function category_follow(search_txt) {
    alert(this.Attr('name'));
}
</code></pre>

<p>here is the code where I create the image dynamically</p>

<pre><code>$.ajax({
url: 'HoverCard_WebService.aspx?q=' + encodeURIComponent(span_text),
type: 'GET',
dataType: 'json',

beforeSend: function () {
    $(".hovercard").prepend('&lt;p class="loading-text"&gt;Yükleniyor...&lt;/p&gt;');
},
success: function (data) {
    $(".hovercard").empty();
    $.each(data, function (index, value) {
        var search_txt = 'TestArif4';
        result += '&lt;div&gt;&lt;button class=\'takibe_al\' name=\'test_name\' id=\'btn_test_id\' onClick=category_follow(\'' + value.id + '\')&gt;&lt;img id=\'img_category_follow\' src=\'images/hover_card_plus_icon.png\' class=\'hover_cursor_hand\' /&gt;&lt;/button&gt;&lt;/div&gt;';
    });
},
</code></pre>
