Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head lang="en">
- <meta charset="UTF-8">
- <title>Mouse Coordinates</title>
- <link rel="stylesheet" href="stylee.css"/>
- <style>
- body {
- text-align: center;
- }
- #coordinates {
- width: 600px;
- height: 500px;
- }
- </style>
- </head>
- <body>
- <label>
- <textarea onmousemove="printCoordinate()" name="mouseCoordinates" id="coordinates" cols="30" rows="10"></textarea>
- </label>
- <script>
- function printCoordinate() {
- var x = event.clientX;
- var y = event.clientY;
- document.getElementById('coordinates').value += 'X:' + x + '; Y:' + y + ' Time: ' + new Date() + '\n';
- }
- document.addEventListener('mousemove', printCoordinate, false);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement