运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <script> function coordinates(event) { document.getElementById("demo").innerHTML = "X = " + event.screenX + "<br>Y = " + event.screenY; } </script> </head> <body> <p onmousedown="coordinates(event)"> Click this paragraph, to display the x and y coordinates of the cursor, relative to the screen. </p> <p id="demo"></p> </body> </html>