JSFiddle - React, Tailwind, and code Playground
HTML
<form action="index.html" method="post">
<input type="submit" value="Submit me!" />
</form>
CSS
body {
font-family: sans-serif;
color: #fff;
text-align: center;
}
input {
border: none;
padding: 20px;
font-size: 20px;
background: #036;
color: #fff;
}
JavaScript
$('form').on('submit', function (e) {
var form = this;
$(this).find('input').css('background', 'green');
setTimeout(function(){
form.submit();
},2000);
e.preventDefault();
});