Monday, December 19, 2016

Time seconds increment on class of elements


function updateAge() {
 $('.age').each(function(){
  var age=$(this).text();
  age++;
  $(this).text(age);
 })
}

$(document).ready(function(){
  console.log('document ready'); 
  setInterval(updateAge, 1000); 
})

No comments: