富贵资源网 Design By www.hznty.com

废话不多说,直接给大家上干货了,写的不好欢迎提出意见。

具体代码如下所示:

function hiddenPass(event)
{ 
var password0 = document.getElementById("password0"); 
var password1 = document.getElementById("password1"); 
if (event.keyCode == 13)
{ 
} 
var keycode; 
if (window.event) 
{ // IE 
keycode = event.keyCode 
} else if (event.which) 
{ // Netscape/Firefox/Opera 
keycode = 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>密 码:</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>

以上代码内容是小编给大家分享的PassWord输入框代码,希望对大家有所帮助!

富贵资源网 Design By www.hznty.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
富贵资源网 Design By www.hznty.com