-
-
Save ragmha/cc8df873abd87d058ff847d89bc0d3f5 to your computer and use it in GitHub Desktop.
Cat Clicker :D
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"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <style id="jsbin-css"> | |
| h1 { | |
| text-align: center; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <h1>Cat clicker! </h1> | |
| <img id="cat" | |
| src="https://lh3.ggpht.com/nlI91wYNCrjjNy5f-S3CmVehIBM4cprx-JFWOztLk7vFlhYuFR6YnxcT446AvxYg4Ab7M1Fy0twaOCWYcUk=s0#w=640&h=426"></img> | |
| <script id="jsbin-javascript"> | |
| var elem = document.getElementById('cat'); | |
| var count = 0; | |
| elem.addEventListener('click', function(e){ | |
| count++; | |
| console.log('I am clicked: '+ count); | |
| console.log('meow'); | |
| }); | |
| </script> | |
| <script id="jsbin-source-css" type="text/css">h1 { | |
| text-align: center; | |
| }</script> | |
| <script id="jsbin-source-javascript" type="text/javascript">var elem = document.getElementById('cat'); | |
| var count = 0; | |
| elem.addEventListener('click', function(e){ | |
| count++; | |
| console.log('I am clicked: '+ count); | |
| console.log('meow'); | |
| });</script></body> | |
| </html> |
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
| h1 { | |
| text-align: center; | |
| } |
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
| var elem = document.getElementById('cat'); | |
| var count = 0; | |
| elem.addEventListener('click', function(e){ | |
| count++; | |
| console.log('I am clicked: '+ count); | |
| console.log('meow'); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment