📜  jquery onclick 在添加另一个 id 和删除旧 id 时不起作用 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:44.449000             🧑  作者: Mango

代码示例1
//You need to use event-delegation, because you are register a event-listiner on an element that not exist by that time.

$('#unfollowAnchor').on("click", function(e){

  //has to be

$(document).on("click", '#unfollowAnchor',function(e){