JSFiddle - React, Tailwind, and code Playground
HTML
<td><input name="test" type="number" max="15" min="1" class="count"></td>
<div>
</div>
JavaScript
$(document).ready(function(){
$(".count").change(function() {
var max = $(this).attr('max');
var input = $(this).val();
if (input > max) {
$("div").html("<span>Error "+input+" "+max+"</span>");
}
else {
$("div").html("<span>Good "+input+" "+max+"</span>");
}
});
});