慕丝3582901
2019-03-27 22:40
<html>
<head>
<script type="text/javascript">
function clock(){
var time=new Data;
document.getElementById("ab").value=time;
}
var cd=setInterval("clock()",1000);
</script>
</head>
<body>
<form>
<input type="text" id="ab"/>
</form>
</body>
</html>
data 改成Date();
<html>
<head>
<script type="text/javascript">
function clock(){
var time=new Date();
document.getElementById("ab").value=time;
}
var cd=setInterval("clock()",1000);
</script>
</head>
<body>
<form>
<input type="text" id="ab"/>
</form>
</body>
</html>
JavaScript进阶篇
468061 学习 · 21891 问题
相似问题