Last active
June 11, 2016 06:47
-
-
Save thedavidmeister/576203ddeff0082ff43389de91b1f0c2 to your computer and use it in GitHub Desktop.
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> | |
<title></title> | |
</head> | |
<body> | |
<script> | |
function clicked() { | |
clicked.counter = clicked.counter || 0; | |
clicked.counter++; | |
var li = document.createElement('li'); | |
document.getElementById('foo').appendChild(li); | |
document.getElementById('bar').textContent = clicked.counter; | |
} | |
</script> <button onclick="clicked();">click me</button> | |
<div id="bar"> | |
</div> | |
<ul id="foo"></ul> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment