JSFiddle - React, Tailwind, and code Playground

by ian_smithz

HTML

<div>This is a cloned text.</div>

JavaScript

var allowClone = true;
var clone;
var interval = setInterval(function () {
    if (allowClone) 
        clone = $('div').clone().first().appendTo('body');
}, 1000);

$(document).click(function () {
    clone = null; // empty it if it was set (optional)
    allowClone = false;
})