一、代码如下
二、效果如下
<!DOCTYPE html> <html> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <body> <h1>我的第一张网页</h1> <p id="demo"></p> <script> var txt = "ABCEDFGHIJKLMNOPQRSTUVWXYZ"; document.getElementById("demo").innerHTML = txt.length; </script> </body> </html>