I have specific div that I want to copy with jQuery. After copying, I want to modify it a little bit and the remove an Input with the ID CustomerDeliveryaddressID. Finally I want to append it somewhere. Unfortunately, the deletion of the part is not working for me. How can I do that? Here is my Code.
$("#addDeliveryAddress").click(function(){
var content = $('.deliveryAddressBox').html();
content = "<div class='deliveryAddressBox'>"+content+"</div>";
content = $(content).remove("#CustomerDeliveryaddressId");
$(".deliveryAddressesContainer").append(content);
});
remove()is not returning the part that is removed. If it is, you are setting the content with what was removed.