These lines of code are in a class I cannot change. It changes the value of an input field. NOTE: the input HTML is part of the original DOM. There is no DOM insertion. Just an input value change.
r = document.getElementById('myinputfield');
r.value = '';
I'm trying to catch when the above script is changing the value. This doesn't work. ( My code is loaded before the change event happens.)
r = document.getElementById('myinputfield');
r.addEventListener("change", function(){
alert('success');
});
When I manually alter the input field value, my code works fine.