I\'m using the following code to detect when a dynamically generated button is clicked.
$(document).on(\"click\",\".appDetails\", function () { alert(\"t
As simple as it can be
Use $(this) here too
$(this)
$(document).on("click",".appDetails", function () { var clickedBtnID = $(this).attr('id'); // or var clickedBtnID = this.id alert('you clicked on button #' + clickedBtnID); });