|
JavaScript length Property
Complete String Object Reference
Definition and Usage
The length property returns the number of characters in a
string.
Syntax
Example
In this example we will show how to use the length property to return the
number of characters in a string:
<script type="text/javascript">
var txt="Hello World!";
document.write(txt.length);
</script>
|
The output of the code above will be:
|
Complete String Object Reference
|