会员
周边
捐助
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
侠岚之弋痕夕
博客园
首页
新随笔
联系
订阅
管理
2017年10月23日
jquery html动态添加的元素绑定事件详解
摘要: 在实际开发中会遇到要给动态生成的html元素绑定触发事件的情况: apple pear 但对于ajax添加进来的html代码段,如$("#xx").html(html内容),如果想里面的元素也会触发我们定义的事件,必须委托 需要用到事件委托,比如: 普通绑定事件:$('.btn1').click(function(){...
阅读全文
posted @ 2017-10-23 17:26 侠岚之弋痕夕
阅读(760)
评论(0)
推荐(0)
编辑
公告
Where is the starting point, we don't have a choice, but the destination where we can pursue!