Js password strength detection, js password strength

Source: Internet
Author: User

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

Related Article

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.