Then I'm counting the characters on a text field. I do not need to update the character count on keypress (no keyboard) The issue is that with jquery's Thank you! .keydown () method, this character refreshes the counter before it is entered, Therefore the counter is always 1 keypress behind the actual calculation. How can I get a count to change keypress, but can I wait for that character's entry?
setTimeout works here:
$ ('input'). KeyDown (function (e) {var $ this = $ (this); settimeout (function () {var text = $ this.val (); console.log (text.length);}, 0);});
Comments
Post a Comment