I have an image that I want to change via jquery:
<div id="imagepr">
<img class="imageprofile" src="$picimgprofile" alt="img" onclick="show_popup('popup_upload')>
</div>
the problem is, I want just to change the IMAGE (.imageprofile) and allow, after it, the onclick function to be called again.
If I change like this:
$("#imagepr").html(data);
it will destroy the onclick; and this:
$(".imageprofile").html(data);
is not working.
what is wrong? how can I change just the image keeping the onclick after it?