drop
event listener.
<canvas>
tag:
yourCanvasVariable.addEventListener(`drop`, drop); function drop(event) { // get the mouse coordinates relative to the box let x = event.offsetX let y = event.offsetY // write code here to position the image in the box }