JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="text">
CSS
input {
border: 1px solid black;
}
input.highlight {
border: 1px solid red;
}
JavaScript
$('#text').change(function() {
var jElement = $(this);
jElement.addClass('highlight');
setTimeout(
function() { jElement.removeClass('highlight'); },
2000
);
});