How do I get the coordinates / position of the mouse cursor in javascript? [duplicate]

-1

Preferably without frameworks.

    
asked by anonymous 06.11.2016 / 04:43

1 answer

2

You can capture this with an event listener:

document.querySelector('body').addEventListener('mousemove', function(event) { var posX = event.clientX, posY = event.clientY; });

    
06.11.2016 / 07:47