Skip to content

Instantly share code, notes, and snippets.

@viller239
Last active August 28, 2016 03:02
Show Gist options
  • Select an option

  • Save viller239/46403e762cdaececd0e57d8ba809f690 to your computer and use it in GitHub Desktop.

Select an option

Save viller239/46403e762cdaececd0e57d8ba809f690 to your computer and use it in GitHub Desktop.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Counter</title>
<link rel="stylesheet" href="./style.css">
</head>
<body style="padding: 50px">
<div class="title">Counter:</div>
<script>
document.addEventListener('click', function () {
var i = 1;
(function tick() {
var e = document.createElement('span');
e.innerText = ' ' + i;
document.body.appendChild(e);
i += 1;
setTimeout(tick, 500);
}())
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment