functionmyClock (e) {var today =newDate()var h =today.getHours()var m =today.getMinutes()var s =today.getSeconds() m =addZero(m) s =addZero(s)e.innerHTML = h +':'+ m +':'+ ssetTimeout(function () {myClock(e) },1000)}functionaddZero (num) {return num >=10? num :'0'+ num}var clockDemo =document.getElementById('clockDemo')myClock(clockDemo)