I’m using javascript/jQuery.. on the keydown of an input[type='text'] I receive a key code. I need to determine whether it’s a character code or a command code because I need to know whether the input will change. I cannot use the change event as this event is postergated until the element loses focus.
I’m using javascript/jQuery.. on the keydown of an input[type=’text’] I receive a key code.
Share
Rather than fiddle with keycodes, why not just keep a cached copy of the value in memory and just compare (and update if necessary) every time a key is pressed: