Length property will give as the number of characters in the string;
For ex:-
<script type="text/javascript">
function get_length()
{
var str = "abcdef";
document.write("before appending new string: " + str.length);
document.write("<br/>");
str = str + "pqr";
document.write("after appending new string: " + str.length);
}
</script>
<asp:Button ID="btn_check" runat="server" Text="Check Length" OnClientClick="get_length();" />
Output will be :-
before appending new string: 6
after appending new string: 9
So it's an easy way to get length in Javascript.