JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Your Website</title>
</head>
<body>
<button id="button">Olá</button>
</body>
</html>
CSS
#button{
width: 200px;
}
JavaScript
const button = document.querySelector("#button");
button.addEventListener("click", loading);
function loading(e){
e.target.textContent = "Loading aqui"
setTimeout(()=>{
e.target.textContent = "Voltei ao normal"
}, 2000)
}