JSFiddle - React, Tailwind, and code Playground

HTML

<script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
<div id="count">0</div>
<div id="content"></div>

JavaScript

$.widget("tst.myWidget", {});

function tst() {
    var $el = $("#count"),
        n = Number($el.text()) + 1;

    $el.text(n);

    $("#content").children().remove().append(
    $("<span>").myWidget());

    if (n % 100 === 0 && $.browser.msie) {
        CollectGarbage();
    }
    setTimeout(tst, 50);
}

$(document).ready(tst);