SyntaxFix
Write A Post
Hire A Developer
Questions
Use
$(document).on("click", "#btn_a", function(){ alert ('button clicked'); });
to add the listener for the dynamically created button.
alert($("#btn_a").val());
will give you the value of the button