執行 ❯
建立您
自己的
網站
×
改變方向
儲存程式碼
改變主題,深色/淺色
前往 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>