I would like to know if my
<input type="text">
field is changed during edition, not only when it’s blured. How to achieve this “nicely” using JQuery? My best idea is to check on every keydown() event if anything has changed, then trigger i.e. change() if so. Can this be done better?
Not really, but I would suggest using keyup, because the value will be 1 keystroke behind at that point.
Example:
User types: “blah”, keydown for the “h” would return the value “bla” because the value hasn’t technically changed yet. Plus what if they hold down the key yielding repeating characters?
keyup isn’t expensive in the browser really if thats what you’re worried about.
What are you trying to accomplish exactly and I can edit this with a better example.