I’m working on a form that calls a function whenever the value of a text field changes. It uses the “keyup” and “change” events for this. But if a user double-clicks the text field and then clicks on an item in their browser’s built-in list of previously entered values, the function doesn’t get called. The user has to click outside of the text field after that in order for the “change” event to be triggered. Any ideas?
Share
You can listen for
focusandblurevents on the input like so:Here’s a working jsFiddle.