Js password strength detection, js password strength
This article provides examples to illustrate the implementation code of js password strength detection and share it with you for your reference. The specific content is as follows:
Run:
This JavaScript code is more practical. It determines the strength of the user's entered password when the user registers. It is divided into three levels: Strong, weak, and three. It can display the corresponding password strength level based on the password entered by the user, this allows you to Improve input.
Implementation Code:
<Html>
Take a look at this item first.
Details:
<Script> function AuthPasswd (string) {if (string. length> = 6) {if (/[a-zA-Z] + /. test (string) &/[0-9] + /. test (string) & amp;/\ W + \ D + /. test (string) {noticeAssign (1);} else if (/[a-zA-Z] + /. test (string) |/[0-9] + /. test (string) |/\ W + \ D + /. test (string) {if (/[a-zA-Z] + /. test (string) &/[0-9] + /. test (string) {noticeAssign (-1);} else if (/\ [a-zA-Z] + /. test (string) & amp;/\ W + \ D + /. test (string) {noticeAssign (-1);} else if (/[0-9] + /. test (string) & amp;/\ W + \ D + /. test (string) {noticeAssign (-1) ;}else {noticeAssign (0) ;}} else {noticeAssign (null) ;}} function noticeAssign (num) {if (num = 1) {response ('{weak'}.css ({backgroundColor: '#009900'}); Response ({backgroundColor: '#009900'}); Response ('{strength'{.css ({backgroundColor: '#009900'}); ('{strength'{.html (''); ('{middle'}.html (''); ('{weak'}.html ('');} else if (num =-1) {response ('{weak'}.css ({backgroundColor: '# ffcc33'}); Response ({backgroundColor: '# ffcc33'}); Response ('{strength'}.css ({backgroundColor :''}); certificate ('{weak'}.html (''); medium ('中'); Certificate ('{strength'}.html ('');} else if (num = 0) {certificate ('{weak'}.css ({backgroundColor: '# dd000000'}); background ({backgroundColor: ''}); Comment ('{strength'}.css ({backgroundColor:''}); Comment ('{weak'{.html ('weak'); comment (''); certificate ('{strength'}.html ('');} else {comment ('{weak'}.html (''); comment (''); Comment ('{weak'}.css ({backgroundColor :''}); certificate ('{middle'}.css ({backgroundColor: ''}); Certificate ('{strength'}.css ({backgroundColor:''}) ;}</script>
The above is all the content of this article, and I hope it will help you learn javascript programming.
Articles you may be interested in:
- Verify the password strength of js on the client and be compatible with FireFox and IE
- JS Code used to determine the password Strength During User Registration
- JavaScript password strength judgment code
- JS password Strength Verification (compatible with IE, Firefox, and Google)
- Javascript password strength verification rules, scoring, and verification (front-end code is provided, and backend code can be translated according to the strength Rules)
- Real-time verification code for Js password strength
- JavaScript to determine the password strength (self-writing code)
- Js Test password strength (low and medium)
- Display password strength using javascript