Last active
March 12, 2021 06:37
-
-
Save bogoreh/f37ace5621e3ee8f6322679173b628f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Spin-off of "Challenge: Cat Clicker"</title> | |
| <style> | |
| body { | |
| font-family: Arial, sans-serif; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <h2>Pet me!</h2> | |
| <img id="cat-pic" src="https://www.kasandbox.org/programming-images/animals/thumbs/cat.png"> | |
| <br> | |
| <div id="cat-chat"></div> | |
| <script> | |
| var catEl = document.getElementById("cat-pic"); | |
| var onCatClick = function(){ | |
| var sayEl = document.getElementById("cat-chat"); | |
| sayEl.textContent = "Meow"; | |
| }; | |
| catEl.addEventListener("click",onCatClick); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment