莫问天涯路几重,轻衫侧帽且从容。这篇文章主要讲述append追加元素后click失效相关的知识,希望能为你提供帮助。
< !DOCTYPE html> < html lang="en"> < head> < meta charset="UTF-8"> < meta name="viewport" content="width=device-width, initial-scale=1.0"> < meta http-equiv="X-UA-Compatible" content="ie=edge"> < title> Document< /title> < script src="http://img.readke.com/220509/03402613a-0.jpg"> < /script> < /head> < body> < ul class="type_list" id="type_list_1"> < li class="active"> 全部< /li> < /ul> < span class="test"> 测试< /span> < /body> < script> $(function() { $(‘#type_list_1 li‘).click(function(event) { console.log(‘123‘); }); $(‘#type_list_1 li‘).on(‘click‘, function() { console.log(‘456‘); }); $(document).on(‘click‘, ‘#type_list_1 li‘, function() { console.log(‘789‘); }); $(‘.test‘).click(function() { $(‘#type_list_1‘).append(‘< li> 歌剧< /li> ‘); }); }); < /script> < /html>
【append追加元素后click失效】
推荐阅读
- 写给Android开发者的混淆使用手册
- MavenCould not open ServletContext resource [/WEB-INF/applicationContext.xml]
- What mind mapping software applications do you recommend.
- yum被lock Existing lock /var/run/yum.pid: another copy is running as pid 1580. Another app is current
- Android插件化的兼容性(上)(Android O的适配)
- Android插件化的兼容性(中)(Android P的适配)
- mybatis源码探究(-)MapperProxyFactory&MapperProxy
- Android内容提供器——运行权限
- OCR移动端车牌识别SDK(打造优质APP)