Jquery 给Js动态新添加的元素 绑定的点击事件

//one
$('.class').on("click",function(){
 alert('one')
});
//相当于$('.class').bind("click",function(){……});

//two
$(document).on("click",'.class',function(){
        alert('two');
});
//相当于$('.class').live("click",function(){……});

 

posted @ 2018-02-12 21:02  温柔的风  阅读(5345)  评论(0编辑  收藏  举报