How can I add an event (by Mootools) to an element just created via set("html"), and inserted through the DOM?
$(document).addEvent("domready", function(){
$(someel).set("html", "<p class='someclass'></p>");
$$("someclass").somefn("click", function(){...});//somefn: that add the "click" event to the <p> element
});
So. via event delegation, adding a single event to top most element:
or chaining it like so, adding events to all elements directly:
method 1 is more performant and allows for adding/removal or matching elements without rebinding.