Cloning Elements in jQuery
The clone method creates deep copies of selected page elements and returns them as a jQuery object.
Let's look at how this method works using a paragraph as an example:
<p class="www">text</p>
After the paragraph, we insert another one of the same, using the method insertAfter:
$('.www').clone().insertAfter('.www');
Clone the div with class www, color it red, give it text '???' and paste it before this div.