here is my problem...
i use ajax and jquery to fill up a form... the user chooses something in a select, and, as he has chosen this or that, ajax returns data, and this data is placed into the form...
sometimes, new elements are created with the ajax data return, example :
ajax returns "blahblah", then i put it in my form, like this :
$("#myDiv").empty();
$("#myDiv").html(ajaxReturn);
IT WORKS FINE! BUT :
the new elements i put into my form are not observed anymore by my jquery...! i have a function like this :
$("#xxxx").on("change",function(){
alert("something");
});
this function works great for the element i have in my form at PAGE LOAD, once this element is replaced by another coming from my ajax call, EVEN IF it has the same ID as the previous one, the actions on it are no more spotted by JQuery...
how can i solve that?
(i really need to replace my select with my ajax return, because sometimes it's no more a select but an input text i need...)
thanks for advices :)