js简单显示动态时间点

时间:2014-05-23 03:53:07   收藏:0   阅读:251
bubuko.com,布布扣
<input type="text" id="showtime" redayonly="redayonly" /> 
<script>
function nowGetTime(){
      var date=new Date();
      document.getElementById("showtime").value=date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds();
}
window.setInterval("nowGetTime()",1000);
</script>
bubuko.com,布布扣

 

js简单显示动态时间点,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!