x
1
2
<html>
3
<head>
4
<meta charset="utf-8">
5
<title>蜜蜂教程(mifengjc.com)</title>
6
<script>
7
function show_coords(event) {
8
var x = event.clientX;
9
var y = event.clientY;
10
alert("X coords: " + x + ", Y coords: " + y);
11
}
12
</script>
13
</head>
14
<body>
15
16
<p onmousedown="show_coords(event)">请在文档中点击。一个消息框会提示出鼠标指针的 x 和 y 坐标。</p>
17
18
</body>
19
</html>