I want to make an alert when a div's innerText changes:
myDiv.addEventListener("change", function() {
if (myDiv.innerText != "some text")
alert('innerText has changed.');
},false);
Does not work, please help.
myDiv.addEventListener("DOMCharacterDataModified", function (event) { // ... add your code he }, false);
use DOMCharacterDataModified to detect innerText change event