JSFiddle - React, Tailwind, and code Playground
HTML
<textarea name = "facilityNotes" id= "facilityNotes" rows= "3" ></textarea>
<span id="res"></span>
JavaScript
var my_id = 'facilityNotes';
window.onload = function() {
var my_id = 'facilityNotes';
document.getElementById(my_id).onkeyup = function(e) {// Listener for key pressing in the field.
var res = 'unchanged';
if (this.oldValue !== this.value) {
this.oldValue = this.value;
res = 'changed';
}
alert(res);
document.getElementById('res').innerHTML = res;
};
}