You will need to use 3 things:
- onpropertychange event , for IE <9
- DOMAttrModified works in IE9, Opera, Firefox and, unfortunately, in all others , since Dr.Molle offers
- Everything else - should resort to a setInterval loop , which checks if the value has changed, this includes webkit browsers (chrome and safari), since they still do not support DOMAttrModified, so - you should resort to checking the cycle for these browsers .
There is a jQuery plugin that implements this (there is also a demo on the page):
http://darcyclarke.me/dev/watch/
source share