When i click on an <input type=text>
, a list of old values appear. If I chose one of them with the mouse, the event "change" from jQuery doesn't trigger.
What event should/could I use to detect this?
When i click on an <input type=text>
, a list of old values appear. If I chose one of them with the mouse, the event "change" from jQuery doesn't trigger.
What event should/could I use to detect this?
You have to use oninput
event, using jquery:
$('#myinput').on('input',function(){
//your code here
});
change
will only trigger if field loose it's focus (blur event). And the term old values appear is browser feature that remembers form data for fields with same name. You can not trigger change
event with that. You need an alternate event like paste
, input
.
$("#field").on("input DOMAttrModified paste",function(){
});
I'm not sure of event. You can try some though.