I have an image 16000x9000 that is displayed on a simple page with predefined size for its container.
myimage.onclick = function(e) {
console.log(e.x, e.y);
};
<p>Image to use:</p>
<img id="myimage" width="900px" height="500px" src="https://via.placeholder.com/150C/O https://placeholder.com/">
I want to click by image and get pixels coordinate. When I click by image I receive 900x500 as output of console.log
and it's obvious incorrect data and means something else.
I expect to get the value approximate to original image width/height when I click on the bottom right corner.
How can I get this data?