Created
November 23, 2015 20:06
-
-
Save anonymous/aab093e38e9d410147bb to your computer and use it in GitHub Desktop.
jQuery Cow Clicker // source http://jsbin.com/zowiya
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> | |
| <title>jQuery Cow Clicker</title> | |
| <script src="https://code.jquery.com/jquery-2.1.4.js"></script> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <button id="myButton">Click</button> | |
| <div id="score"></div> | |
| <script id="jsbin-javascript"> | |
| clicks=0; | |
| $(document).ready(function(){ | |
| $("#myButton").on("click", function(){ | |
| clicks=clicks+1; | |
| console.log(clicks); | |
| if(clicks==10){ | |
| alert("stop clicking me!"); | |
| } | |
| $("#score").append(clicks); | |
| }); | |
| }); | |
| </script> | |
| <script id="jsbin-source-javascript" type="text/javascript">clicks=0; | |
| $(document).ready(function(){ | |
| $("#myButton").on("click", function(){ | |
| clicks=clicks+1; | |
| console.log(clicks); | |
| if(clicks==10){ | |
| alert("stop clicking me!"); | |
| } | |
| $("#score").append(clicks); | |
| }); | |
| });</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
| clicks=0; | |
| $(document).ready(function(){ | |
| $("#myButton").on("click", function(){ | |
| clicks=clicks+1; | |
| console.log(clicks); | |
| if(clicks==10){ | |
| alert("stop clicking me!"); | |
| } | |
| $("#score").append(clicks); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment