JSFiddle - React, Tailwind, and code Playground
HTML
<button id="btn">Clique aqui</button>
CSS
#btn {
background: green;
color: white;
border: 0;
border-radius: 5px;
padding: 15px;
cursor: pointer;
}
.disabled {
background: grey !important;
cursor: not-allowed !important;
pointer-events: none;
}
JavaScript
$button = $('#btn');
$button.click(function() {
$button.addClass('disabled').text('Aguarde...');
setTimeout(function() {
$button.removeClass('disabled').text('Clique aqui');
/* 2000 = 2 segundos. */
}, 2000);
});