I need to be able to count characters in textarea as the text is typed in, except anything that is surrounded by { }. I need to print the count below the text area. I’ve seen a few counters in JavaScript but am not sure how to exclude { enclosed text } from it. Do I do it on click?
<textarea id="myInput"></textarea>
Counter: <span id="charCount"></span>
Thanks.
Here you go:
Live demo: http://jsfiddle.net/simevidas/8R9DH/
The regex that I use is not the best choice. Use the regex literals provided by @Matt or @Pointy.
Here:
Live demo: http://jsfiddle.net/simevidas/8R9DH/2/