稍后追加而不是删除

append later not remove

<div class="cast">
   <p id="addnew">
      <input type="text"><b id="add">ADD</b>
  </p>
</div>
$(document).ready(function(){
    $("#add").click(function(){
        $("#addnew").append("<p><input type=\"text\"><u id=\"del\">delete<u></p>");
    });
    $('#ab').click(function(){
       alert(); 
    });
});

我点击了#add。追加 <p><input type=\"text\"><u id=\"del\">delete<u></p> 稍后单击 #del。没有功能。

我有两个 ajax 函数。调用 PHP 包含 html 代码

您应该使用 on 来绑定您的 del 点击事件:

$(document).on("click","#del", function(e) {
...
});

您可以在此处找到有关 on 的文档:http://api.jquery.com/on/