Note that .getElementsByTagName() returns a NodeList collection of objects, so you need to explicitly state that you’re looking for the first instance by accessing the first index with [0]. https://developer.mozilla.org/en-US/docs/Web/API/NodeList
Is there something that’s out there that I can use that will allow me to draw a line on an image, and then for it to give me the coordinates of the line?
You will be able to easily get the x,y coords for anywhere on the image.
Making things easier, you can in a web browser have the coords for where you click, shown in the console.
Or, as I know that you hate the idea of using the console (correct me if I’m wrong), you can go to the extra effort to make your own on-screen results area and show the click information there instead.
If you want only line information to be shown, the x,y can be remembered by a script and when you release the mouse button, both that starting x,y and the ending x,y can be shown.
To help make the development of this easier, because there are several types of approaches that can be made, for what intended end results are you wanting this line coordinate information for?
How easy to understand? How well do you understand click event properties?
screenX Read only long The X coordinate of the mouse pointer in global (screen) coordinates.
screenY Read only long The Y coordinate of the mouse pointer in global (screen) coordinates.
clientX Read only long The X coordinate of the mouse pointer in local (DOM content) coordinates.
clientY Read only long The Y coordinate of the mouse pointer in local (DOM content) coordinates.
I would say that it’s about twice as difficult as recording the loading time of an image, and displaying the result.
Does that sound like a fair approximation, @Mittineague?