jQuery cannot recognize appended cloned elements using jQuery.appendTo()

后端 未结 3 1842
一生所求
一生所求 2021-01-20 06:04

I want to make a list of group inputs allow user to dynamically let user add/remove group row:

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-20 07:06

    jQuery 1.7+

    j(".form-denomination").on("click", ".delete-denomination", function(){
        j(this).parent().remove(); 
    });
    

    jQuery 1.3+

    j(".delete-denomination").live("click", function(){ 
        j(this).parent().remove(); 
     });               
    

    jQuery 1.4.3+

    j(".form-denomination").delegate(".delete-denomination", "click", function(){ 
       j(this).parent().remove(); 
    }); 
    

提交回复
热议问题