How do you get the length of a string in jQuery?
It's not jquery you need, it's JS:
alert(str.length);