JSFiddle - React, Tailwind, and code Playground

HTML

<input type="button" id="copy" value=" copy "/>

<div id="content">
    <span>here's a span</span>
    <div>and a div</div>
</div>
<div id="copy">
   asdf
</div>

JavaScript

$(function()  {
    $('#copy').click(function(){
        var content = $('#content').html();
        var newdiv = $("#copy");
        newdiv.html(content);
        $('#content').after(newdiv);
    });
  });