Reputation: 51463
I'd like to use jQuery.clone()
but I only want to copy the inner elements, not the element itself. If needed I can wrap the contents but I was hoping to find another way to just clone the inner html.
Thanks.
Upvotes: 2
Views: 1225
Reputation: 238115
You need to use contents
to get all the child nodes (and their descendants):
$('#foo').contents().clone(true).appendTo('#bar');
Upvotes: 2