So, if I understand correctly, you want him to read the "password" or something in ordinary letters until someone clicks on it, and at that moment it becomes empty, and everything that is typed there becomes * ? Good thing you want:
in the head:
<script type="text/javascript"> function changefield(){ document.getElementById("passwordbox").innerHTML = "<input id=\"password-field\" type=\"password\" name=\"password-field\" title=\"Password\" />"; document.getElementById("password-field").focus(); } </script>
in body:
<div id="passwordbox"> <input id="password-field" type="text" name="password-field" title="Password" onfocus="changefield();" value="password" /> </div>
source share