Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the Document</title> </head> <body> <input type="button" value="Click" id="inputId"> <script> inputId.onclick = function(event) { // show event type, element and coordinates of the click alert(event.type + " at " + event.currentTarget); alert("Coordinates: " + event.clientX + ":" + event.clientY); }; </script> </body> </html>