This article mainly introduces how to implement the input password input box based on JS Code to change the input password to black-dot ciphertext, and how JS can obtain the values of multiple input boxes with the same name. The code is easy to understand and very good, it has reference value. If you need it, please refer to the following to see how to implement the input password Text Box Based on JS Code and change the input password to black-dot ciphertext. The Code is as follows:
Html code
Js Code
Function checkForm () {var input_pwd = document. getElementById ('input-password'); var md5_pwd = document. getElementById ('md5-password'); // convert the plaintext entered by the user to md5: md5_pwd.value = toMD5 (input_pwd.value); // proceed to the next step: return true ;}
Supplement: JS obtains the values of multiple input boxes with the same name.
The document is used at first. all. id. length to get the number of input boxes, but sometimes normal, sometimes show undefined, the effect is not very good, online information said document. all is not compatible with all browsers. Now it seems that only Internet Explorer is supported.
The solution is as follows:
Var els = document. getElementsByName ("search"); for (var I = 0, j = els. length; I <j; I ++) {alert (els [I]. value );}
The above is a small series of JS Code for you to implement the input password input box, enter the password to change the blacklist ciphertext, I hope to help you, if you have any questions, please leave a message, the editor will reply to you in a timely manner. I would like to thank you for your support for PHP chinnet!
For more information about how to use JavaScript to obtain the values of multiple input boxes with the same name, see PHP!