JSFiddle - React, Tailwind, and code Playground

by Brian Duffey

HTML

<div id="counter">0</div>

JavaScript

function inc() {
    var counter = jQuery('#counter'), count = parseInt(counter.text(), 10);
    count++;
    counter.text(count);
    if (count === 50) alert('test');
}

jQuery(function () {
    setInterval(function () {
        inc();
    }, 1000);
});