Skip to content

Instantly share code, notes, and snippets.

@baltazarparra
Created August 4, 2016 09:40
Show Gist options
  • Save baltazarparra/6601f426e3b0a076cb136404360d56b3 to your computer and use it in GitHub Desktop.
Save baltazarparra/6601f426e3b0a076cb136404360d56b3 to your computer and use it in GitHub Desktop.
(function(window, document){
'use strict';
var $input = document.querySelector('[data-js="input"]');
var $start = document.querySelector('[data-js="start"]');
var $stop = document.querySelector('[data-js="stop"]');
var $reset = document.querySelector('[data-js="reset"]');
var interval;
$start.addEventListener('click', startTimer, false);
function startTimer() {
$input.value = +$input.value + 1;
setTimeout(startTimer, 1000);
}
})(window, document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment