Invoke a callback when a DOM element is inserted into the document