$(function(){ var html = $('.target-copy').html(); // copy html $('.target-paste').html( html ); // paste html });
<div class="well"> <strong>copied html:</strong> <span class="label label-info target-copy">The quick <em>brown fox</em> jumps over the <span style="color:yellow;">lazy dog</span>.</span> </div> <div class="well"> <strong>pasted html:</strong> <span class="label label-success target-paste"></span> </div>