<div id="testdiv">
  <ul></ul>
</div>
需要给<ul>里面动态添加的<li>标签添加click事件

jquery 1.7版以前使用live动态绑定事件

$("#testdiv ul li").live("click",function(){
});
jquery 1.7版以后使用on动态绑定事件
$("#testdiv ul").on("click","li", function() {
     //do something here
 })

相关文章:

  • 2022-12-23
  • 2021-10-19
  • 2021-10-19
  • 2021-10-19
  • 2021-10-19
  • 2021-10-19
猜你喜欢
  • 2021-10-19
  • 2021-10-19
  • 2021-10-19
  • 2022-12-23
相关资源
相似解决方案