jquery为动态生成的元素添加点击事件

<div class="box"></div>

给div.box动态生成的子元素添加点击事件,div.box元素必须是html页面中存在的,.boxchild元素是动态生成添加点击事件的元素

$(".box").on('click','.boxchild',function(){
		console.log("aaaa");
	});


猜你喜欢

转载自blog.csdn.net/LLL_liuhui/article/details/80707725