JSFiddle - React, Tailwind, and code Playground

by jasper

HTML

<div id="oldContainer">
    <img src="http://chachatelier.fr/programmation/images/mozodojo-mosaic-image.jpg" />
    <img src="http://chachatelier.fr/programmation/images/mozodojo-mosaic-image.jpg" />
    <img src="http://chachatelier.fr/programmation/images/mozodojo-mosaic-image.jpg" />
</div>
<div id="newContainer"></div>

CSS

#oldContainer {
    background : yellow;
    display    : none;
}
#newContainer {
    background : red;
}

JavaScript

var $clone = $('img').clone();


var $newElement = $('<div />').addClass('content-left').html('<div>Some HTML String</div>').append($clone);

//then you can add the new element(s) to the DOM
$newElement.appendTo('#newContainer');