I want to execute a function when some div or input are added to the html. Is this possible?
For example, a text input is added, then the function should be called.<
or you can simply Create your own event, that run everywhere
$("body").on("domChanged", function () {
//dom is changed
});
$(".button").click(function () {
//do some change
$("button").append("i am the new change");
//fire event
$("body").trigger("domChanged");
});
Full example http://jsfiddle.net/hbmaam/Mq7NX/