📅  最后修改于: 2022-03-11 15:02:33             🧑  作者: Mango
var counter = 0;
$("button").click(function() {
$("h2").append("click me " + (++counter) + "
")
});
// With on():
$("h2").on("click", "p.test", function(){
alert($(this).text());
});