when you append by using an existing content, jquery will delete the orignal:
$(new).append($('#ori'));
then the orignal $('#ori')
in the document will be deleted, is this by
design?
when you append by using an existing content, jquery will delete the orignal:
$(new).append($('#ori'));
then the orignal $('#ori')
in the document will be deleted, is this by
design?
Try:
$(new).append($("#ori").clone());
if you want to keep the original.
Adds a node to the end of the list of children of a specified parent node. If the node already exists it is removed from current parent node, then added to new parent node.
If you want to keep the original element, use cletus' code.