You will need to get the textbox via javascript when moving the mouse over it and change its type
to text
. And when moving it out, you will want to change it back to password
. No chance of doing this in pure CSS.
HTML:
<input type="password" name="password" id="myPassword" size="30" />
<img src="theicon" onmouseover="mouseoverPass();" onmouseout="mouseoutPass();" />
JS:
function mouseoverPass() {
let obj = document.getElementById('myPassword');
obj.type="text";
}
function mouseoutPass() {
let obj = document.getElementById('myPassword');
obj.type="password";
}