Example:
<form>
<input type="image" id = 'toothsImage' src="someImg.jpg" alt="Submit" />
</form>
Image form TYPE acts much like the INPUT TYPE=SUBMIT field, but unlike the SUBMIT field, the coordinates of the image that were activated are sent back to the server in addition to the rest of the form data. So - when one clicks on input=image - request will be appended with click coordinates like so:
x=1&y=2
My question is - how can one retrieve these coordinates using javascript without submitting the form.
P.S 1: I'm aware that click coordinates can be calculated in many ways. I know them and can easily use them. I'm interested in this approach only since here browser calculates everything automatically.
P.S 2: I need to get coordinates that are relative to the image, not the document.