很久 没有更新了
[JS]文字逐字挨没
代码以下
<!DOCTYPE html> <html> <head> <meta charset="UTF- 八"> <title>Title</title> </head> <body> <div id="content"></div> </body> <script> window.onload = function() { let word = '尔是一个个的文字,逐步 的被挨没 '; let n = 0; let t = setInterval(function() { n++; console.log('n:' + n + ",word.length:" + word.length); if(n > word.length) clearInterval(t); document.getElementById('content').innerText = word.substring(0, n); }, 一00); } </script> </html>