JSFiddle - React, Tailwind, and code Playground
by wallabykid
HTML
<div class='draggable'></div>
<input type='button' class='content' value='go'/>
<div class='demo'></div>
CSS
.draggable{
border: solid red;
width: 100px;
height: 100px;
}
JavaScript
$(function() {
$( ".draggable" ).draggable();
$( ".draggable" ).draggable();
$('.content').click(function(){
var htmlData='<div class="draggable ui-widget-content"><p>Drag me around</p></div>';
$('.demo').append(htmlData);
$('.draggable:not(.ui-draggable)').draggable(); //Here
});
});