kekskurse.de/themes/nostyleplease/assets/js/mouse_coords.js

9 lines
275 B
JavaScript
Raw Permalink Normal View History

2024-07-28 22:39:10 +00:00
const p = document.createElement("p");
p.style.textAlign = "center";
p.style.fontSize = "18pt";
p.innerHTML = "C'mon, move your mouse!"
document.body.append(p);
document.addEventListener("mousemove", e => {
p.innerHTML = `mouseX: ${e.clientX}, mouseY: ${e.clientY}`;
});