JSFiddle - React, Tailwind, and code Playground
by fliptheweb
HTML
<input type="text" id="vel"/>
<button id="submit">validate</button>
JavaScript
$("#submit").click(function(e) {
validVel($('#vel').val());
});
function validVel(v) {
v = parseFloat(v);
if (v > 3) {
$('.er').fadeIn(2000);
var error = "Too High";
$('.er').text(error);
}
else if (v< 0.15) {
$('.er').fadeIn(2000);
var error = "Too Low";
$('.er').text(error);
}
else {
$('.er').fadeIn(2000);
var error = "Okay";
$('.er').text(error);
}
}