慕盖茨8203141
2020-05-25 09:44
<script type="text/javascript"> var attime; function clock(){ var time=new Date(); attime= time.getHours().toString()+":"+time.getMinutes().toString()+":"+time.getSeconds().toString() ; document.getElementById("clock").value = attime; } setInterval(clock,1000);</script>
<script type="text/javascript">
var attime;
function clock(){
var time=new Date();
var myarr=time.split(" ");
attime=myarr[4];
document.getElementById("clock").value = attime;
}
setInterval(clock,1000);
</script>
setInterval(clock,1000);
JavaScript进阶篇
468192 学习 · 21891 问题
相似问题