Answers for "print mouse click x and y"

2

print mouse click x and y

function printMousePos(event) {
  document.body.textContent =
    "clientX: " + event.clientX +
    " - clientY: " + event.clientY;
}

document.addEventListener("click", printMousePos);
Posted by: Guest on August-25-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language