For dojo 1.7, based on the jQuery answer, I would do:
require(["dojo/on", "dojo/_base/array"], function(on, array){ on(dojo.doc, "DOMNodeInserted", function(evt){ var classes = dojo.attr(evt.target, "class").split(" "); if (array.indexOf(classes, "myclass") > -1) { console.debug("Inserted node with class myclass", evt.target); } }); });
Philippe
source share