标签:set interval 如何 seconds gets innerhtml ntb nbsp size
用js:
function testDate(){
var date=new Date();
var result=date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds();
document.getElementById("mydate").innerHTML=result;
}
setInterval("testDate()", 1000);
在body里:
<p id="mydate"></p>
标签:set interval 如何 seconds gets innerhtml ntb nbsp size
原文地址:http://www.cnblogs.com/yuxiliang/p/6537593.html