D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
steveharoz
Full window
Github gist
click location
<!doctype html> <html> <head> <meta charset="utf-8"> <title>PAGE TITLE</title> <style> img { border: 2px solid black; cursor: crosshair; } </style> </head> <body> <h1>Click the image</h1> <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/Chicago_Cubs_Logo.svg/476px-Chicago_Cubs_Logo.svg.png" width="300" onclick=" var outputString = 'X:' + event.offsetX + ' Y:' + event.offsetY; document.getElementById('location_text').textContent = outputString;" /> <p id="location_text"></p> </body> </html>