<!DOCTYPE html>
<html onmousemove="showCoords(event)">
<body >
<h1 align="center" style="color:rgb(123, 117, 212)">
Move Your Mouse and Get Position of Cursor</h1>
<p id="demo"></p>
<script>
function showCoords(event) {
var x = event.clientX;
var y = event.clientY;
var coords = "X coords: " + x + ", Y coords: " + y;
document.getElementById("demo").innerHTML = coords;
}
</script>
</body>
</html>
Comments
Post a Comment
If you any doubt of any topic then you can comment me.