JQuery 关于复制或者删除html块

1、复制当前ul

var content = $("#" + id).closest("ul").clone(true);
            content.find("a").replaceWith('<a class="red pl5" name="Delete" href="#">删除</a>');
            content.find(".nameNum").html("签约人" + parseInt(count + 1));
            content.find(":checkbox").removeAttr("checked");
            content.appendTo("#DetainDocument");

2.移除ul块

$("[name='Delete']").live({ "click": function () { $(this).closest("ul").remove(); $("#addDocumentType").removeAttr("disabled"); } });

 

posted on 2016-06-17 15:56  月&&生  阅读(838)  评论(0编辑  收藏  举报