JSFiddle - React, Tailwind, and code Playground

by InferOn

HTML

<div id="on">CLICK THIS : <span id="status">ENABLED</span></div>
<button id="run">LOAD</button

JavaScript

$('#run').on('click', function () {
    var i = 0;
    $('#run').attr("disabled", "disabled");
    var go = setInterval(function () {
        
        i++;
        $('#run').html('Loading ' + i + ' or 10...');
        $('#status').html('DISABLED');
        $(document).unbind('click keyup keypress keydown');
        if (i === 10) {
            clearInterval(go);
            $('#status').html('ENABLED');
            $('#run').html('DONE');
            $('#run').removeAttr("disabled");        
        }
    }, 1000);
});

$('#on').on('click', function () {
    $('#status').html('CLICKING');
});