JSFiddle - React, Tailwind, and code Playground
HTML
<body onload="testFunction()">
<div id="txt"> Loading </div>
<script>
function testFunction() {
setTimeout(function(){document.getElementById("txt").innerHTML = "";}, 2000);
}
</script>
</body>
CSS
#txt{
width: 100px;
height: 100px;
position: absoulut;
margin-left: auto;
margin-right: auto;
margin-top: 50%;
}