[读码时间] 显示单击的坐标
说明:代码取自网络
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>显示单击的坐标</title> <style> pre{ color:green; padding:10px 15px; background:#f0f0f0;/*白色*/ border:1px dotted #333;/*黑色*/ font:12px/1.5 Courier New;/*行高18px*/ } span{ color:#999;/*灰黑色*/ } </style> <script> document.onclick = function (event) { var event = event || window.event; alert("坐标:[" + event.clientX + ", " + event.clientY + "]"); } </script> </head> <body> <pre> <script type="text/javascript"> var event=event||window.event; alert("坐标:["+event.clientX+", "+event.clientY+"]"); </script> </pre> </body> </html>