For example add to all new links attribute target with value _blank or to all new <div>s attribute title with random value. Any ideas except setTimout()?
UPD: I need something like .attrGlobal(). This answer allows to do that only with links and their attribute , but how to do that with all elements and all their attributes?target
UPD2: Trying MutationObserver as SLaks recommended but firefox freezes when clicking on add button http://jsfiddle.net/1337/wvfkc/5/.
Finally found solution.
jsfiddle.netIn options you need
subtree: truealways, and if you changes attributes do not add to optionsattributes: truebecauseMutationObserver(function(mutations, observer) {will go into the eternal cycle and browser freezes.