input控件 <%--自动更新时间--%> <div> <input type="button" value="确定" /> <input type ="text" id="t1" /> </div> js代码 function time() { var q7 = document.getElementById("t1"); var d = new Date(); q7.value = d.toLocaleDateString()+" "+d.toLocaleTimeString(); setInterval (time,1000) }