<script>
var hour, minute, second; //时 分 秒
hour = minute = second = 0; //初始化
var int;

function p(s) {
return s < 10 ? '0' + s: s;
}

function reset() {
window.clearInterval(int);
document.getElementById('timetext').innerHTML = '00:00:00';
hour = minute = second = 0;
}

function start() {
int = setInterval(timer, 1000);
}
//计时
function timer() {
second++;
if(second >= 60) {
second = 0;
minute = minute + 1;
}

if(minute >= 60) {
minute = 0;
hour = hour + 1;
}
document.getElementById('timetext').innerHTML = p(hour)+':'+p(minute)+':'+p(second);
}
</script>