I understand that in Javascript, the 'keypress' event fires when a character gets inserted into the screen and the 'input' event fires when the input field of yours changes. I've seen many good explanations of the different types of events like here, but I was more wondering about the difference between those two events since they seem so similar. Specifically:
- What, if at all, is the difference between keypress and input events? In my quick testing, it seems like keypress happens first, but is that it?
- Under what circumstances would I use one over the other?