jQuery - Encuentra elementos creados dinámicamente sin eventos
Aunque ya se ha hecho esta pregunta, y la respuesta es esta:
$('#container').on('click','#dynamicElement', function(){ /* the code */ });
El código anterior encontrará el#dynamicElement
cuando se hace clic en él. Pero, ¿qué pasa si no hay clic ni ningún otro evento?
Supongamos el siguiente escenario:
$.ajax(
url:'file.php',
data: {'param':'value'},
success: function(response){
/*
how would I get #dynamicElement if it was not click on?
the element had no event fired at all, nor had any of its parennt
containers.
Now what?
*/
}
);