This question already has an answer here:
- jQuery .on function for future elements, as .live is deprecated [duplicate] 2 answers
I have a form thats loads an image. I need to do a function that is been called by the image Onclick Event.
The problem is that the selector ( I'm using jQuery) can't find the image id, because when the function is loaded the image wasn't yet there.
SOLUTION :
After the image upload -->
$("#"+foto_nom).bind({
click:function(){
alert(this.id); }
});
Binding an event is the solution.