Skip to content

Instantly share code, notes, and snippets.

Created March 22, 2016 17:41
Show Gist options
  • Save anonymous/4c64641e747658e7a864 to your computer and use it in GitHub Desktop.
Save anonymous/4c64641e747658e7a864 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/yoqokehuta
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<button id="1">click me!</button>
<p id="2"></p>
<script id="jsbin-javascript">
count = 0;
$("#1").click(function(){
count++;
$("#2").html(count);
if (count > 20){
alert("stop clicking me!");
}
});
</script>
<script id="jsbin-source-javascript" type="text/javascript">count = 0;
$("#1").click(function(){
count++;
$("#2").html(count);
if (count > 20){
alert("stop clicking me!");
}
});</script></body>
</html>
count = 0;
$("#1").click(function(){
count++;
$("#2").html(count);
if (count > 20){
alert("stop clicking me!");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment