JSFiddle - React, Tailwind, and code Playground

by Salvatore Farsaci

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<div class='source'>
  <p>This is a paragraph.</p>
  <p>This is another paragraph.</p>
</div>
<button>Clone all p elements, and append them to the body element</button>

JavaScript

$(document).ready(function() {
  $("button").click(function() {
    $("p:not(.copy)").clone().addClass('copy').appendTo("body");
  });
});