var m=0,h=0,s=0;
var time_id;
//计时器
time_id = setInterval(time,1000);
function time() {
if(s>0 && (s%60) == 0) {m++;s=0}
if(m>0 && (m%60) == 0) {h++;m=0}
if(h<10) {
var hour='0'+h;
} else {
var hour=h;
}
if(m<10) {
var minute='0'+m;
} else {
var minute=m;
}
if(s<10) {
var second='0'+s;
} else {
var second=s;
}
$('#time').text(hour+':'+minute+':'+second);
s++;
}