3 ms·
Yeah, that'd probably be a one-liner JavaScript. Something like: onclick="getElementById('pwd').type='text';" But you'd want a bit more to toggle it. Still,
by benhoyt 17y ago
Yeah, that'd probably be a one-liner JavaScript. Something like:
onclick="getElementById('pwd').type='text';"
But you'd want a bit more to toggle it. Still, maybe a slightly better way -- and a way to address the security issue at the same time -- would be to show the password when you hover over the field with your mouse. Is there a way to do this easily with JS?
- dugmartin 17y agoYou can do it in jQuery very easily. Give your password field the id of "hover-password" and add the following jQuery snippet: $(function() { $("#hover-password").hover( function() { this.type = "text"; }, function() { this.type = "password"; } ); });