</div> <script> functionrun(){ //实例化 Date var date = newDate(); //获取时分秒 var h = date.getHours(); var i = date.getMinutes(); var s = date.getSeconds(); //处理 h = (h < 10) ? '0' + h : h; i = (i < 10) ? '0' + i : i; s = (s < 10) ? '0' + s : s; //写入表 document.getElementById('iWatch').innerHTML = h + ':' + i + ':' + s; }