<!DOCTYPE html>
<html>
<head>
<form name="form_name">
<input type="text" name="MouseX" value="0" size="3">X<br />
<input type="text" name="MouseY" value="0" size="3">Y<br />
</form>
<script>
document.onmousemove = getMouseXYPosition;
function getMouseXYPosition(e)
{
var X = 0;
var Y = 0;
X = e.pageX;
Y = e.pageY;
document.form_name.MouseX.value = X;
document.form_name.MouseY.value = Y;
}
/*
run:
You will get the mouse X Y position in input text
*/
</script>
</body>
</html>