Events triggered by dynamically generated element are not captured by event handler

后端 未结 5 2034
失恋的感觉
失恋的感觉 2020-11-21 05:46

I have a

with id=\"modal\" generated dynamically with the jQuery load() method:

$(\'#modal\').load(\'handl         


        
5条回答
  •  执念已碎
    2020-11-21 06:39

    Function binds are made ​​in page load. To work on elements created dynamically using the function live (). Example:

    $ ("p"). live ("click", function () {
        // Your function
    });
    

提交回复
热议问题