I have this .append function which generates a button for every element:
.append('<button type="button" id="add">Hinzufügen</button>')
Then i have this function which should do something when I click on the button above. The function works on a button which is not "appended".
$(document).ready(function () {
$("#add").on("click", function () {
alert("Test");
});
});
Does anyone know, why this doesn't work?