As far as I understand, the “onchange” event of a text input element is only fired when two conditions are true:
- The text has changed.
- The field no longer has focus.
So when you click off, it fires the event. How can I fire an event when the text has changed, but the field still has focus?
you have access to the
keypress,keyup, andkeydownevents; the details of when those fire can be found at Quirksmode.