Updating a property valuewill not result in a change event. The change event is triggered by the user.
You can either write a function that changes the value, and does everything you need ...
function changeTextarea(str) {
document.getElementById('a').value = str;
}
... or query the meaning textarea...
(function() {
var text = getText();
var getText = function() {
return document.getElementById('a').value;
}
setInterval(function() {
var newtext = getText();
if (text !== newText) {
}
text = newText;
}, 100);
})();
... onchange() .
document.getElementById('a').onchange();
(, onchange.)
- . - , textarea value.