Elements appended from AJAX call aren't accessible

前端 未结 3 2045
春和景丽
春和景丽 2021-01-28 13:07

I insert element from the php file as a result of successful ajax call. But for some reason that and everything in it is missing when I look at my source code of the page. It

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-28 13:41

    You're most likely binding the click event handlers to your delete divs on document ready. When you add new divs, the click event handlers are not automatically bound to the new elements.

    So, after updating your data, bind the event handlers again, and you will be good to go.

提交回复
热议问题