我的代码:
HTML
<div id="box">
<div class="mappa-infobox">
<div class="pulsanti">
<span class="pulsante selected">YES</span>
<span class="pulsante">NO</span>
</div>
</div>
</div>
<div id="example"></div>
jQuery
$(".mappa-infobox .pulsante").on("click", function () {
console.log("ciao");
});
$(window).load(function () {
$('#example').html($('#box').html());
});
似乎,在加载文档并mappa-infobox
在 div 内“克隆”之后example
,处理程序不会被触发。为什么?