Good day all,
I have a form that has a password field:
<input type="password" name="password" size="30" />
Naturally, the input text will be replaced by (*).
So if the user typed 123
the box will show ***
.
Up to here, it is straight forward, but...
Now, I wanna add a small icon next to the password box so when the user hover over this icon, he can see what he has entered so far.
So, while hovering, the box will show 123
and when the user leaves the icon the box should show ***
again.
Is there any way to do this with JavaScript? Also, I am using HTML and PHP.
EDIT:
It really doesn't need to be an icon, it could be a checkbox or a button... AND if it could be done in CSS, I would really appreciate to know how
P.S. I've googled and search the stackoverflow but with no luck
Try This :
In HTML and JS :
Its simple javascript. Done using toggling the
type
attribute of the input. Check this http://jsfiddle.net/RZm5y/16/a rapid response not tested on several brosers, works on gg chrome / win
-> On focus event -> show/hide password
script jQuery
1 minute googling gave me this result. See the DEMO!
HTML
jQuery
CSS