html文件:
<p id="clock"></p>
<input type="button" value="dianji" onclick="count()">
js文件:
function count(){
var time=new Date();
var attime= time.getHours()+"."+time.getMinutes()+"."+time.getSeconds() ;
document.getElementById("clock").innerHTML=attime;
}
var attime = setInterval(count(),100);
stone310
相关分类