How do you get the length of a string in jQuery?
You don't need jquery, just use yourstring.length. See reference here and also here.
yourstring.length
Update:
To support unicode strings, length need to be computed as following:
[..."