Examples are as follows:
function Hiddenpass (event) {
var password0 = document.getElementById ("password0");
var password1 = document.getElementById ("Password1");
if (Event.keycode = =) {
}
var keycode;
if (window.event) {//IE
keycode = Event.keycode
} else if (Event.which) {//Netscape/firefox/opera
keycod E = Event.which
}
var Keychar = String.fromCharCode (keycode);
Password1.value = Password1.value + Keychar;
Password1.value = password1.value.substring (0, password0.length);
}
function Clearpass () {
$ ("#password0"). Val ("");
$ ("#password1"). Val ("");
<li class= "ba" ><label> password:</label>
<input type= "text" id= "password0" onfocus= "
Javascript:clearpass (); "
Onkeyup= "This.value=this.value.replace (/./g, ' * ')"
onkeypress= "Javascript:hiddenpass (event);" />
<input type= "hidden" id= "Password1" name= "Password1"/>
</li>
The above simulation of the Password input box implementation code is a small series to share all the content, hope to give you a reference, but also hope that we support the cloud habitat community.