I know that usually you want to strip these out, but I need the true char count and I can't find out how to get it...
Thanks for the help
I know that usually you want to strip these out, but I need the true char count and I can't find out how to get it...
Thanks for the help
What's wrong with .length
? That counts line breaks as characters (I assume you meant a line break by 'ENTER'?)
Use the length
property on any string to get its character count. E.g.
'this is an example string'.length // == 26
or, for jQuery:
$('#my_textarea').html().length
N.B. use html()
not text()
to avoid having jQuery do things like removing line-breaks.