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