Elements appended from AJAX call aren't accessible

前端 未结 3 2044
春和景丽
春和景丽 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:21

    Look at jQuery.on()

    Delegate the click event of your delete div Eg-

    $(document).on("click",".btn",function(){//bind click event for all .btn type
    alert("clicked");
    });
    

    DEMO

提交回复
热议问题