JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="test">
<button id="btn">ok</button>

JavaScript

$('#btn').on('click', function(){
	$('#test').val(123);
})

setInterval(function(){
	var el = $('#test');
	if (el.val() != el.data('old-value')){
  	el.data('old-value', el.val())
    myfunc();
  }
}, 1000);

//$('#test').on('change', function(){
//	alert('alert');
//});

function myfunc(){
	alert('111111111');
};