The following code works:
var foo = '<%= tbHeaderBGColor.ClientID %>'; function changetext() { alert('function called'); if (event.propertyName == 'style.backgroundColor' && event.srcElement.pluggedElement != null) alert(event.propertyName); event.srcElement.pluggedElement.style.backgroundColor = event.srcElement.style.backgroundColor; } if (!!document.addEventListener) { document.getElementById(foo).addEventListener("DOMAttrModified", changetext, false); } else { document.getElementById(foo).addBehavior("foo.htc"); document.getElementById(foo).attachEvent("onpropertychange", changetext); }
DOM Mutation Events
source share