JSFiddle - React, Tailwind, and code Playground

by Academia

HTML

<p id="test"></p>

JavaScript

document.getElementById("test").innerHTML += "a";

var intervalHandle = setInterval(function(){
    callback();
}, 200);

document.getElementById("test").innerHTML += "c";

function callback() {
    document.getElementById("test").innerHTML += "b";  
    //here where should be located all the code supposed to be executed after the timeinterval.
    clearInterval(intervalHandle);
    //here where should be located all the code supposed to be executed after the clearInterval.
}