This is a known behavior of a change event. It does not fire until the element has lost focus. From the docs:
A change event is dispatched to an element when its value changes. This Event is limited to items, boxes, and items. For selection fields, checkboxes, and radio buttons, the event fires immediately when the user makes a choice with the mouse, but for other types of elements the event is delayed until the element loses focus.
Instead, I would associate the script with keyup (you could use other key events, but in this context, it is most appropriate to use up):
jQuery( "#text" ).keyup(function(){ var numberOfChars = jQuery( "#text" ).val().length; jQuery( "#counter" ).html( numberOfChars ); });
source share