Bind "insertion into DOM event" for not-yet-appended element
I'm looking for something like this:
var div = document.createElement('div');
div.id = 'proprioceptiveDiv';
$(div).on('appendedToDOM', function() {
// ...
});
document.body.appendChild(div); // triggers above handler
Does this exist? I'm using jQuery and would rather not import a whole
plugin or another library just for this ability, so I'm only interested in
a short solution.
No comments:
Post a Comment