Skip to content

Instantly share code, notes, and snippets.

@bogoreh
Last active March 12, 2021 06:37
Show Gist options
  • Select an option

  • Save bogoreh/f37ace5621e3ee8f6322679173b628f7 to your computer and use it in GitHub Desktop.

Select an option

Save bogoreh/f37ace5621e3ee8f6322679173b628f7 to your computer and use it in GitHub Desktop.
<!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