Skip to content

Instantly share code, notes, and snippets.

@raelmax
Created August 24, 2011 13:55
Show Gist options
  • Save raelmax/1168120 to your computer and use it in GitHub Desktop.
Save raelmax/1168120 to your computer and use it in GitHub Desktop.
Timer - JqueryBrasil
var alvo = document.getElementById("id_origem"),
data = new Date();
var addTime = function(){
data.setSeconds(data.getSeconds() + 1);
alvo.value = data.getHours() + ":" + data.getMinutes() + ":" + data.getSeconds();
};
setInterval(addTime, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment