javascript - Find coordinate on image client sided -


i've got png 800x800. after clicking on position(pixel) on image, let's 200x300 want save these coordinates.

what approach these coordinates relative image when clicking it?

i don't expect give me code, reference good.

actually <input type="image"> html element need.

<form action="/action_page.php" method="post">   <input type="image" src="https://68.media.tumblr.com/avatar_c5ab8cc59f62_128.png" alt="submit" width="128" height="128"> </form> 

when clicked, submits form , returns coordinates of click within image in x & y variables (post or get, depending on form's method attribute).

demo : https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_input_height_width


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -