Can't call with javascript appended class using jquery
<p>I can't call the class which is appended with javascript in jquery. It just doesn't respond to it at all.</p>

<p>I append the html with this:</p>

<pre><code>$(function () {
var $scntDiv = $('#parts');
var i = $('#parts input').size();

$('#addField').on('click', function () {
    var part = '&lt;div id="parts' + i + '"&gt;&lt;hr /&gt;&lt;input type="text" id="auto_part' + i + '" class="auto_part" name="auto_part' + i + '" placeholder="Dio" /&gt;&lt;br/&gt;' +
        '&lt;textarea type="text" id="auto_description' + i + '" class="auto_description" name="auto_description' + i + '" placeholder="Vise informacija"&gt;&lt;/textarea&gt; &lt;br /&gt;' +
        '&lt;a href="#" class="addPhoto' + i + '" style="display:block;"&gt;Add Photo&lt;/a&gt;&lt;input type="file" name="auto_image" class="auto_image' + i + '" style="display:none;" /&gt;&lt;a href="#" class="removefield"&gt;Izbrisi dio&lt;/a&gt;&lt;/div&gt;';
    $scntDiv.after(part);
    $("#row_count").val(i);
    i++;
    return false;
});

$(document).on("click", ".removefield", function () {
    if (i &gt; 2) {
        $("#row_count").val(i);
        $(this).parent('div').remove();
        i--;
    }
    return false;
});
</code></pre>

<p>});</p>

<p>So it creates addPhoto2, addPhoto3 and so on. But when I use this:</p>

<pre><code>$(function () {
    $(".addPhoto2").click(function(){
       console.log("Hello");
    });
});
</code></pre>

<p>It just doesnt do anything with addPhoto2. While I can call addPhoto itself which is loaded as default.</p>
