JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="foo" />
JavaScript
var value=$('#foo').val();
setInterval(function(){
if(value!=$('#foo').val()){
value=$('#foo').val();
//here you need to write what will happen if the value is changed
alert('changed');
}
},50);