In this fiddle, i am not able to get the Dynamic Event Handler
onclick event to be triggered for the dynamically generated button.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
even if you add the “onclick” to the button, it is not parsed and processed by browser, and the event handler is never created.
Your best option is create an event handler out of the button itself, remove the “onclick” line, and this in the document ready block:
this will work as the event handler attaches itself to the #d1, and delegates the event itself to the clicked buttons. If you create or destroy buttons, this does not affect the handler.