<html>
<head>
<script>
function show_coords(event) {
document.getElementById("demo").innerHTML = "X= " + event.clientX + "<br>Y= " + event.clientY;
}
</script>
</head>
<body>
<p onmousedown="show_coords(event)">
单击此段落可显示鼠标指针的 x 和 y 坐标。</p>
<p id="demo"></p>
</body>
</html>