Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. <body>
  2.  
  3. <h2 onclick="showCoords(event)">
  4. =============================<br>
  5. potential area that contains the rectangle
  6. =============================<br>
  7. </h2>
  8.  
  9. <p><strong>Hint:</strong> Try to click different places in the heading.
  10. </p>
  11.  
  12. <p id="demo"></p>
  13.  
  14. <script>
  15. function showCoords(event) {
  16. var x = event.clientX;
  17. var y = event.clientY;
  18. var coords = "X coords: " + x + ", Y coords: " + y;
  19. document.getElementById("demo").innerHTML = coords;
  20. }
  21. </script>
  22. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement