问答详情
源自:8-3 计时器setInterval()

利用定时器实现无限循环增加

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>定时器</title>

<script type="text/javascript">

  var attime=0;

  function clock(){

        

    attime++ ;

    document.getElementById("clock").value = attime;

  }

  setInterval(clock,1)

</script>

</head>

<body>

<form>

<input type="text" id="clock" size="50"  />

</form>

</body>

</html>


提问者:玄众妙 2019-05-25 11:50

个回答

  • 程序猿廖宜聪
    2019-06-27 18:53:48

    优秀优秀