JSFiddle - React, Tailwind, and code Playground
HTML
<textarea id="mytext"></textarea><button id="mybtn">change input</button>
JavaScript
var onChange = function(){
alert('input changed');
}
var changeInput = function(){
text.value = 'Hello World';
text.onchange();
}
button = document.getElementById('mybtn');
button.onclick = changeInput;
text = document.getElementById('mytext');
text.onchange = onChange;