80991930 2013-12-20
代码如下:
// jQuery 1.4.3+ $( elements ).delegate( selector, events, data, handler ); // jQuery 1.7+ $( elements ).on( events, [selector], data, handler );
代码如下:
$("table").delegate("td","click",function(){ alert("hello"); });
代码如下:
$("table").on("click", "td", function() { alert("hi"); });
代码如下:
$("table").delegate("button","click",function(){...}); $("table").on("click", "p", function(){...});
代码如下:
$("table").on("click", ".td1", function() { alert("hi"); });