Definition and Usage The length property returns the number of characters in a string. Syntax stringObject.length Example In this...
Definition and Usage
The length property returns the number of characters in a string.Syntax
stringObject.length |
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:
12 |