为类名相同的节点添加事件
$(document).on(“click”,“指定的元素”,function(){});是将指定的事件绑将document上,只要而新产生的元素符合指定的元素,就会绑定此事件 。
$(document).on("click",".class名",function(){
var id = $(this).attr('id');
.....
})
为类名相同的节点添加事件
$(document).on(“click”,“指定的元素”,function(){});是将指定的事件绑将document上,只要而新产生的元素符合指定的元素,就会绑定此事件 。
$(document).on("click",".class名",function(){
var id = $(this).attr('id');
.....
})