JSFiddle - React, Tailwind, and code Playground
HTML
Text1:<input type="number" id="text1" /><Br />
Text2:<input type="number" id="text2" />
JavaScript
document.getElementById("text2").addEventListener("change", function() {
if($('#text1').val() < $('#text2').val()) alert();
});