I create a list of buttons with this instruction:
$("ul#cards").append("<li><button id="modifiedCard" type="button" class="btn btn-primary btn-xs pull-left">Modified</button></li>");
Ok, it works. Buttons are generated correctly.
In the same page I wrote:
$("#modifiedCard").click(function () {
alert("Hello!");
});
But, when I click on one of them the alert doesn't start.
I tried with:
<button id="modifiedCard">Try</button>
and the alert starts.
Why?