I'm trying to show a password in an input field when I hover my mouse over it and after 1 second change it back to password.
This is what I have:
if (this.type === 'password') {
this.type = "text";
setTimeout(function () {
this.type = "password";
}, 100)
}
It changes the password to text, but doesn't change it back. I'm trying to do it this way to stop the code changing all text fields to passwords.
Any idea how I can do this ?
Thanks