How to handle dynamically generated javascript elements on button click

24 Views Asked by At

I am trying to create a task lists of employee management system using table and rows. I have created static html row and also implemented Jquery-UI calendar in that which is working perfectly fine. I can copy paste that static html row the calendar works fine for multiple static rows. But if I created row using append function in Jquery the row gets created but calendar no longer works on dynamically generated row. Because dynamically created row is not able to attach events of DOM at page load please help.

I tried event delegation and also use on instead of click but not able to solve this

1

There are 1 best solutions below

1
Sulaxan On

after adding the dynamically created rows add $( "className" ).datepicker(); where className will be the class of dynamically added jquery-ui calender fields