I have this this image with onclick function on it
<img id='1213' src='img/heart.png' onclick='heart(this.id)'>
which to call this function :
function heart(id) {
$('#heart').dialog('open');
return false;
}
How can i show the ID inside the div?
<div id="heart">
Name : ABC
ID : The ID need to be here
</div>
P/S : i have reason why i want to use the onclick instead directly using the jquery get val from the image id directly.
onclick) when you have jQuery.$('#heart').html(id).dialog('open');$( "#heart" ).on( "click",function(){ });instead of inline html.