I want to detect whenever a textbox’s content has changed. I can use the keyup method, but that will also detect keystrokes which do not generate letters, like the arrow keys. I thought of two methods of doing this using the keyup event:
- Check explictly if the ascii code of the pressed key is a letter\backspace\delete
- Use closures to remember what was the text in the textbox before the key stroke and check whether this has changed.
Both look kinda cumbersome.