為什么document.write(time)就不能實(shí)現(xiàn)動(dòng)態(tài)更新??
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>計(jì)時(shí)器</title>
<script type="text/javascript">
? var int=setInterval(clock, 100)
? function clock(){
??? var time=new Date();
??? document.write(time);
? }
</script>
</head>
<body>
? <form>
??? <input type="text" id="clock" size="50"? />
? </form>
</body>
</html>
2015-03-24
謝謝 不過運(yùn)行了你的代碼,沒有看到動(dòng)態(tài)更新啊求解
2015-03-18
這么寫就可以了