Twenty-four, JavaScript takes a string of length

A, as follows

Second, the effect is as follows

<!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>

 

Guess you like

Origin www.cnblogs.com/tianpan2019/p/11314723.html