I am having a problem with adding a basic onclick listener in canvas in javascript, I want to retrieve the (x, y) coordinates for it, I would appreciate any help please.
Thank you.
I am having a problem with adding a basic onclick listener in canvas in javascript, I want to retrieve the (x, y) coordinates for it, I would appreciate any help please.
Thank you.
Try this..
document.getElementById('canvasId').addEventListener('click',function(evt){
alert(evt.clientX + ',' + evt.clientY);
},false);