JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css">
<div>Count is <span></span> </div>
<div><button>Start Timer</button></div>

JavaScript

$(function() {
$("button").click(function() {
    function counter()  {  
        var i = 10;
        
        
            
        if (i < 0)
            return 
        setTimeout(showDIV, 1000);
        $("span").text(i);
        i--;        
        
    }
        
    showDIV();
}
counter(10);
});

});