<body onmousemove=getXY()>
<a id=pr></a>
<script>
function getXY(){
x=window.event.screenX;
y=window.event.screenY;
pr.innerText="X="+x+",Y="+y;
}
</script>
</body>

解决方案 »

  1.   

    不知道相对哪里:
    x=window.event.x;
    y=window.event.y;
      

  2.   

    天啊,你好快啊相对屏幕event.screenX,event.screenY相对窗口event.clientX,event.clientY
      

  3.   

    micky说的是相对屏幕,不是网页工作区。
      

  4.   

    还有一种<body onmousemove=getXY()>
    <a id=pr></a>
    <script>
    function getXY(){
    x=window.event.x+window.screenLeft;
    y=window.event.y+window.screenTop;
    pr.innerText="X="+x+",Y="+y;
    }
    </script>
    </body>