Click the mouse on the canvas to get the mouse x,y position within the canvas.
The coordinates will still work after the browser has been resized. Try resizing the browser to test this.
Note that this canvas is 500 by 500 pixels.