I have two fields in my form, I need handle event when browser changes value of them, my fields are username and password; I've used this $('input').on('input change',function(e){//...})
, but when I select a user name in list that popped up by my browser, value of password changes but 'input'
event of password not working in that case.
How can I handle that ?
Code:
HTML:
<form action="/">
<input name="username" type="text" />
<br />
<input name="password" type="password" />
<br />
<input type="submit"/>
</form>
Js:
$('input[type="password"]').on('change keyup',function(event){
console.log(event.type);
});
It's working when I'm typing in password field, but not working when browser auto complete is changing password value.