im creating a list of links out of an AJAX call that will do a $.each and append elements to a div. In terms of design everything is fine but as you can see im creating a favorite script with that <i>. When i click that <i> nothign happens, i tried to put a z-index:100 and still nothing it wont trigger the click(). I did it in HTML and it worked but when i switched it to the $.each it stopped working.
$.ajax({
method: 'post',
url: myurl,
data: {obj},
dataType: 'json',
complete: function (data) {
if (data.responseJSON != 'fail' && data.responseJSON) {
$.each(data.responseJSON, function (index, value) {
$('#'+id).append('' +
' <div class="result_container">\n' +
' <a class="a_tab_content" href="#">'+value[4]+'</a>\n' +
' <i class="favoritestar fa fa-star favorite_checked"></i>\n' +
' </div>'
);
});
}
});