文字一个个出现的demo

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<pre id="showWord"></pre>
<div style="display:none" id="word">
   xxxxxxxxxxxxxxxxxxxxx
</div>
<script language="javascript">
    var index=0;
    var word=document.getElementById("word").innerHTML;
    function type(){
        document.getElementById("showWord").innerText = word.substring(0,index++);
    }
    setInterval(type, 200);
</script>
</body>
</html>

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-01
  • 2022-12-23
  • 2021-08-03
  • 2021-11-11
猜你喜欢
  • 2022-01-20
  • 2022-12-23
  • 2021-04-23
  • 2021-11-30
  • 2021-08-20
  • 2021-11-12
  • 2022-12-23
相关资源
相似解决方案