案例:javascript案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
4
<script type="text/javascript">
5
function coordinates(event)
6
{
7
x=event.screenX
8
y=event.screenY
9
alert("X=" + x + " Y=" + y)
10
}
11
12
</script>
13
</head>
14
<body onmousedown="coordinates(event)">
15
16
<p>
17
在文档中点击某个位置。消息框会提示出指针相对于屏幕的 x 和 y 坐标。
18
</p>
19
20
</body>
21
</html>
22