I'm working on adapting an IE-specific website to other browsers. For example, onpropertychange has been used extensively, and I'm using MutationObserver to emulate that behavior.
However, I can't get MutationObserver to react on value changes to input=text fields, neither on programmatic changes nor user input.
Consider:
<input type="text" name="test1" id="test1" />
and
var config = { attributes: true, childList: true, characterData: true, subtree: true };
var observer = new MutationObserver(function() { alert('success'); } );
observer.observe(document.getElementById('test1'), config);
If I try to change the value by document.getElementById('test1').value = 'something' or keyboard input, nothing happens.
However, if I try to change something else about the element, for example its id or name (by JavaScript), the MutationObserver fires.
Value changes and MutationObserver work fine with other input types, event with the value of hidden fields.
This behavior is consistent across browsers.
Does anybody know how I can observe value changes on text fields? Or do I have to approach this differently?