I need to capture any changes to the contents of a cell inside my web page.
The following code shows me that addEventListener is not working.
function modifyText() { alert("!"); } var el=document.getElementById("mycell"); el.innerHTML="a" el.addEventListener("change", modifyText, false); // After next instruction I expect an alert message but it does not appear... el.innerHTML="Z";
Code is just a toy example. In my real case, the changes on the page (and therefore in the cell too) were made using webapp, with which I DO NOT control.
javascript addeventlistener
tic
source share