Is it possible to know the click position in the javascript page? So, if you know the x,y position and want to the user to click that, return x,y? and making some maths, if the object in my page is a circle, can I add the polar ecuation coordinates of the circle in the (x,y)?
already tryed this when the image is clicked
var container = document.getElementById("portada");
container.addEventListener("onClick", getClickPosition, false);
function getClickPosition(e){
var xpos = e.clientX;
var ypos = e.clientY;
console.log("x"+xpos);
console.log("y"+ypos);
}
But it gives me the undefined x and y, just tryed a similiar one and still undefined, any suggest?