Output string value and length : String Declaration « String « JavaScript Tutorial






<html>
<head>
<script type="text/javascript" language="javascript">
<!-- //
onload = function(){
 var myString = "AAA";
 document.write(myString + " has a length of " + myString.length + " characters.");
 }
// -->
</script>
</head>
<body>

</body>
</html>








6.4.String Declaration
6.4.1.Output string value and length
6.4.2.Define HTML tags as the string variable