Here is the simple JQuery script snippet for detecting current mouse coordinates using JQuery function.
$(document).mousemove(function(e){ console.log("X = " + e.pageX + " and Y = " + e.pageY); });
we can achieve above result with JavaScript , here is the snippet with JS.
window.onmousemove = function handleMouseMove(event) { console.log("X = " + event.clientX + " and Y = " + event.clientY); }