为什么我从jquery生成的按钮没有事件?为什么我从jquery生成的按钮没有事件?
<input type='button' value='Populate' id='pop'/>
<input type='button' value='Click' id='btn'/>
$('#pop').on('click', function(){
var clone = $('input[id*=btn]').clone();
$(this).after(clone);
});
$('#btn').on('click', function(){
alert('clicked');
});
您需要了解[事件委托](http://learn.jquery.com/events/event-delegation/)。 – 2014-08-29 08:42:33