JSFiddle - React, Tailwind, and code Playground
by David Thomas
HTML
<input value="7" />
CSS
input {
border-width: 5px;
border-style: solid;
}
JavaScript
$('input').on('change', function(){
var v = parseInt(this.value, 10);
$(this).css('border-color', function(){
var v = parseInt(this.value,10);
return isNaN(v) ? '#000' : v < 7 ? '#f00' : v == 7 ? '#0f0' : '#f90';
});
}).change();