Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. dom - document object model
  2.  
  3. <!DOCTYPE html>
  4. <html lang="en">
  5. <head onmousemove="doAnotherThing()">
  6. <meta charset="UTF-8">
  7. <title>Hamilton</title>
  8. </head>
  9. <body onmousemove="doAnotherThing()">
  10. <h1 onmouseover="doTheThing()">Alexander Hamilton</h1>
  11. <p onmousemove="doAnotherThing()">Here is the story of the life of Hamilton.</p>
  12. <p onmouseover="doAnotherThing()">
  13. <script>
  14. console.log(doTheThing());
  15. </script>
  16. </p>
  17.  
  18.  
  19. <script>
  20. function doSomething() {
  21. console.log("You clicked me!");
  22. }
  23. function doAnotherThing() {
  24. console.log("You touched the p tag... :D");
  25. var x = event.clientX;
  26. var y = event.clientY;
  27. console.log("X coordinate: ", x);
  28. console.log("Y coordinate: ", y);
  29. }
  30. function doTheThing() {
  31. console.log("Oh no! You touched the H1 tag...!");
  32. var x = event.clientX;
  33. var y = event.clientY;
  34. console.log("X coordinate: ", x);
  35. console.log("Y coordinate: ", y);
  36. }
  37. </script>
  38. </body>
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement