So, basically I have a plugin that I want called on an element if it is created in the dom,
E.g. let's say I have a plugin called domWatch that runs the function if the specified selector gets created inside the selector it was called on.
so:
$('#container').domWatch('.mySelector', function(element){
$(element).myPlugin();
});
$('#container').append($('<div />', {class: 'mySelector'})); //the new element should now have the myPlugin plugin called on it.
Is this possible to do?