Example:
Code:

<html>
 <body>
 <script type="text/javascript"> 
{

var txt="John";
document.write(txt.length);
}
 </script>
 </body> 
</html>

Output:

4

eXTReMe Tracker