<html>
<head>
<script>
function coordinates(event) {
document.getElementById("demo").innerHTML = "X = " + event.screenX + "<br>Y = " + event.screenY;
}
</script>
</head>
<body>
<p onmousedown="coordinates(event)">
Click this paragraph, to display the x and y coordinates of the cursor, relative to the screen.
</p>
<p id="demo"></p>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_dom_event_screenxy by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:41:14 GMT -->
</html>