var timer;
$(document).ready(function(){
if (timer == undefined)
timer = window.setInterval(showTime, 1000);
});
//显示时间
function showTime() {
var now = new Date();
document.getElementById("spanTime").innerHTML = now.toLocaleTimeString();
}
更多专业前端知识,请上 【猿2048】www.mk2048.com