jQuery: detecting new elements with the MutationObserver object A common problem in JavaScript and jQuery regards the insertion of new elements: how can we detect when a new element has been inserted into the document? The insertion of new elements that we don't know in advance could be controlled in the past through the DOMNodeInserted event: $( document ).on( "DOMNodeInserted", function( e ) { c
![jQuery: detecting new elements with the MutationObserver object](https://cdn-ak-scissors.b.st-hatena.com/image/square/6cfbc54ff1bf8562ef75828154726fbe87ab47a9/height=288;version=1;width=512/https%3A%2F%2Fcdn.gabrieleromanato.com%2F5c37214980b3%2Fuploads%2F2012%2F07%2Fjquery.jpg)