I am trying to make sure that when I click an image
<div id="getImage" class="gallery_grid_item md-card-content">
<img onClick="handleImage()" src ="img.png">
</div>
<div id="holdImage">
</div>
then it is placed into another div
function handleImage() {
var $img = $("#getImage").children("img");
$("#holdImage").append($img);
}
However, I've double and triple checked this but the function still shows as undefined in the console?
What's going on here?
"in<img onClick="handleImage() src ="img.png">"getImage"implies your targetting an element. You probably forgot to add theidorclassspecifier (#, or.)getImageshould be prefix with#or....