Live feedback on how many characters are left in the text box

I have a textarea element that I want to limit to, say, 100 characters. my current task is to give visual feedback to the user. Starting with an empty box, it should be "100 characters to the left."

Now I added the javascript function charsLeft () to textarea onChange, but it only works 50% for the intended purpose. It only updates the div containing the number when I leave (focus) the text field, and not as a type. how am i going to do this? So that my user can see how they type, how many characters they left in my text box?

+3
source share
3 answers
+1

keyup . cut paste, , , , mouseup. , - , Firefox 2 Opera, cut paste.

0

, Flapjax - . . .

0

Source: https://habr.com/ru/post/1747350/


All Articles