Skip to content

Instantly share code, notes, and snippets.

@nashingofteeth
Last active August 29, 2015 14:13
Show Gist options
  • Save nashingofteeth/3b154f76388afcf25192 to your computer and use it in GitHub Desktop.
Save nashingofteeth/3b154f76388afcf25192 to your computer and use it in GitHub Desktop.
get cursor position
document.addEventListener("mousemove", function(event) {
mouseX = event.pageX;
mouseY = event.pageY;
document.body.innerHTML = mouseX + " " + mouseY;
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment