http://www.codeproject.com/Questions/172557/identify-a-clicked-button-from-a-dynamically-creat
You will need to bind "click" to the jQuery "live" function/event for that to work. I would also recommend using either a special CSS class or id on the dynamically generated button. Here is the description of the live even from jQuery.com.
When you bind a "live" event it will bind to all current and future elements on the page (using event delegation). For example if you bound a live click to all "li" elements on the page then added another li at a later time - that click event would continue to work for the new element (this is not the case with bind which must be re-bound on all new elements).
<script type="text/javascript">
$(document).ready(function() {
//$(":button") would select all buttons
//.className would work on an button with a CSS Class assignment of ClassName
//Below shows how to do it on a specific ID
$("#MyNewButtonID").live("click", function(event) {
alert("Thanks for visiting!" + this.value);
});
});
</script>
Premalatha
Software Engineer
Mahe, if this helps please login to Mark As Answer. | Alert Moderator