Created
February 27, 2018 07:12
-
-
Save anonymous/a931e78ed4e24aa046d59e281e8ca87b to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/qapupugeke
This file contains 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> | |
</head> | |
<body> | |
<p class="counter ausgabe">Counter ist bei 0</p> | |
<button class="start btn">Counter starten</button> | |
<script id="jsbin-javascript"> | |
document.querySelector('button.start.btn').addEventListener('click', function(event){ | |
var i = 0, | |
c = setInterval(function(){ | |
if(i > 10) return clearInterval(c); | |
document.querySelector('p.counter.ausgabe').innerHTML = 'Counter ist bei ' + i++; | |
}, 100); | |
}); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">document.querySelector('button.start.btn').addEventListener('click', function(event){ | |
var i = 0, | |
c = setInterval(function(){ | |
if(i > 10) return clearInterval(c); | |
document.querySelector('p.counter.ausgabe').innerHTML = 'Counter ist bei ' + i++; | |
}, 100); | |
});</script></body> | |
</html> |
This file contains 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
document.querySelector('button.start.btn').addEventListener('click', function(event){ | |
var i = 0, | |
c = setInterval(function(){ | |
if(i > 10) return clearInterval(c); | |
document.querySelector('p.counter.ausgabe').innerHTML = 'Counter ist bei ' + i++; | |
}, 100); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment