Created
August 4, 2016 09:40
-
-
Save baltazarparra/6601f426e3b0a076cb136404360d56b3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(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