jQuery on()方法是官方推荐的绑定事件的一个方法。$(selector).on(event,childSelector,data,function,map)由此扩展开来的几个以前常见的方法有.bind() $("p").bind("clic ...
jQuery on()方法是官方推荐的绑定事件的一个方法。
$(selector).on(event,childSelector,data,function,map)
由此扩展开来的几个以前常见的方法有.
bind() $("p").bind("click",function(){ alert("The paragraph was clicked."); }); $("p").on("click",function(){ alert("The paragraph was clicked."); });delegate() $("#div1").on("click","p",function(){ $(this).css("background-color","pink"); });
原标题:jQuery on()方法
关键词:jquery
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。