<html><body onmousemove="f()">
<INPUT id=aa>
<Script>
function f(){
aa.value="x:"+window.event.x+" y:"+window.event.y;
}
</Script>
</body></html>

解决方案 »

  1.   

    event.clientX  Retrieves the x-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars. event.clientY  Retrieves the y-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars. 
    event.offsetX  Sets or retrieves the x-coordinate of the mouse pointer's position relative to the object firing the event. event.offsetY  Sets or retrieves the y-coordinate of the mouse pointer's position relative to the object firing the event. event.screenX  Retrieves the x-coordinate of the mouse pointer's position relative to the user's screen. event.screenY  Retrieves the y-coordinate of the mouse pointer's position relative to the user's screen. 
    event.x  Retrieves the x-coordinate of the mouse pointer's position relative to the parent element. event.y  Retrieves the y-coordinate of the mouse pointer's position relative to the parent element.