JSFiddle - React, Tailwind, and code Playground

by Jaganathan

HTML

<div id="test"> 
   Some text <span class="text"></span>
</div>

CSS

.text {
    color: Green;
    font-weight: bold;
}

JavaScript

var elem = $('.text');
var count = 0;
function updateLabel() {
    elem.html(count++);
}
updateLabel();
// span will be updated 2 seconds once.
myCounter = setInterval(updateLabel, 2000);