為什么不可以執(zhí)行?
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>計時器</title>
<script type="text/javascript">
?? var i;
?? function clock(){
????? var time=new Date();?????????????? ??
????? document.getElementById("clock").value = time;
?? }
??? i =setInterval("clock()",1000);
??? function continue(){
??? i=setInterval("clock()",1000);
??? }
</script>
</head>
<body>
? <form>
??? <input type="text" id="clock" size="50"? />
??? <input type="button" value="Stop" onclick="clearInterval(i)"/>
??? <input type="button" value="start" onclick="continue()">
? </form>
</body>
</html>
文本框里什么也沒有
2016-01-22
continue是關(guān)鍵字來的,改一下函數(shù)名