my have some trouble to call a JavaScript/jQuery 1.9.1 method on dynamic added html-elements.
Here is my JS-code:
$(".download").live("click", function() {
var buttonId = $(this).attr("id");
alert(buttonId);
});
My dynamic HTML code:
var html = "";
for(var i = 0; i <daten.length; i++) {
html += "<input id='" + daten[i].pfad + "' class='download' type='image' width='25px' height='25px' src='/download.png'/>";
}
$("#table").append(html);
I get no error message, but the method is besides not calling, what is here not correct?