Tho this question has been asked before, and the answer is this:
$(\'#container\').on(\'click\',\'#dynamicElement\', function(){ /* the code */ }); >
$(\'#container\').on(\'click\',\'#dynamicElement\', function(){ /* the code */ });
If your new element is being added to the page inside the success callback, at that point you can call $('#dynamicElement')
success
$('#dynamicElement')
Using $('#dynamicElement') anywhere outside of the callback would not return the element since it had not been added to the DOM yet.