jQuery hover not working with dynamic elements

后端 未结 2 355
情话喂你
情话喂你 2021-01-17 04:26

Im getting data out of a database, and based on the number of matches, I want to output this:

 
      
2条回答
  •  悲&欢浪女
    2021-01-17 05:07

    You should use delegates for dynamically created objects.

    $(document).on("hover","#link_delete",function(){
      $(this).attr('src', 'images/account_related/icons/link_delete_h.png');
    });
    

提交回复
热议问题