Use JavaScript to evaluate the intensity of the user input password

xiaoxiao2021-03-31  234

The password is already an indispensable tool in our lives, but an unsafe password may have unnecessary losses to us. As a website designer, if we can securely evaluate the password entered in the web page, and display the corresponding prompt information, it will help the user set a secure password. At the same time, the site is more human and is more attractive.

What is a secure password? This program evaluates in the following ways.

1. If the password is less than 5, then it is considered to be a weak password.

2. If the password consists only of a number, lowercase letters, uppercase letters, or other special symbols, it is considered to be a weak password.

3. If the password consists of two components of numbers, lowercase letters, uppercase letters, or other special symbols, it is considered a moderately secure password.

4. If the password consists of three or more of the numbers, lowercase letters, uppercase letters, or other special symbols, it is considered to be a relatively secure password.

This program will display different colors according to the password input by the user, and the specific procedure is as follows (demo address: http://www.web9898.cn/reg):