$(function () { var idx = 0; // v1.4 $("#div1").delegate("input[type=button]", "click", function () { alert("delegate"); }); // v1.7 $("#div1").on("click", "input[type=button]", function () { alert("on"); }); $("#Btn_Add").click(function () { idx += 1; $("#div1").append('<input type="button" value="' + idx + '">'); // v1.0 $("#div1>input[type=button]").bind("click", function () { alert("bind"); }); }); });
<input id="Btn_Add" type="button" value="add" /> <div id="div1"></div>