Password input box code sharing _javascript Tips

Source: Internet
Author: User

Nonsense not to say, directly to everyone on dry goods, write a bad welcome to give comments.

The specific code looks like this:

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 
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> 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 code content is small to share the password input box code, we hope to help!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.